gpt4 book ai didi

r - 比较回归模型与 R

转载 作者:行者123 更新时间:2023-12-05 00:00:14 25 4
gpt4 key购买 nike

中是否有可用的工具?电话 生成可发表的回归表?我正在写一篇类(class)论文,我需要在其中比较几个回归模型,如果我能让它们嵌套在像 this one 这样的单个表中,我会很高兴。 ,来自 estout斯塔塔包。

我查了 xtable ,但无法达到相同的结果。任何提示将不胜感激。

这是我的想法:

Multiple Nested Regressions

最佳答案

您可能想要 mtable 'memic' 包中的函数。它具有关联的 LaTeX 输出参数:

==========================================================================
Model 1 Model 2 Model 3
--------------------------------------------------------------------------
Constant 30.628*** 6.360*** 28.566***
(7.409) (1.252) (7.355)
Percentage of population under 15 -0.471** -0.461**
(0.147) (0.145)
Percentage of population over 75 -1.934 -1.691
(1.041) (1.084)
Real per-capita disposable income 0.001 -0.000
(0.001) (0.001)
Growth rate of real per-capita disp. income 0.529* 0.410*
(0.210) (0.196)
--------------------------------------------------------------------------
sigma 3.931 4.189 3.803
R-squared 0.262 0.162 0.338
F 8.332 4.528 5.756
p 0.001 0.016 0.001
N 50 50 50
==========================================================================

这是你得到的 LaTeX 代码:
texfile123 <- "mtable123.tex"
write.mtable(mtable123,forLaTeX=TRUE,file=texfile123)
file.show(texfile123)
#------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Calls:
% Model 1: lm(formula = sr ~ pop15 + pop75, data = LifeCycleSavings)
% Model 2: lm(formula = sr ~ dpi + ddpi, data = LifeCycleSavings)
% Model 3: lm(formula = sr ~ pop15 + pop75 + dpi + ddpi, data = LifeCycleSavings)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{tabular}{lcD{.}{.}{7}cD{.}{.}{7}cD{.}{.}{7}}
\toprule
&&\multicolumn{1}{c}{Model 1} && \multicolumn{1}{c}{Model 2} && \multicolumn{1}{c}{Model 3}\\
\midrule
Constant & & 30.628^{***} && 6.360^{***} && 28.566^{***}\\
& & (7.409) && (1.252) && (7.355) \\
Percentage of population under 15 & & -0.471^{**} && && -0.461^{**} \\
& & (0.147) && && (0.145) \\
Percentage of population over 75 & & -1.934 && && -1.691 \\
& & (1.041) && && (1.084) \\
Real per-capita disposable income & & && 0.001 && -0.000 \\
& & && (0.001) && (0.001) \\
Growth rate of real per-capita disp. income & & && 0.529^{*} && 0.410^{*} \\
& & && (0.210) && (0.196) \\
\midrule
sigma & & 3.931 && 4.189 && 3.803 \\
R-squared & & 0.262 && 0.162 && 0.338 \\
F & & 8.332 && 4.528 && 5.756 \\
p & & 0.001 && 0.016 && 0.001 \\
N & & 50 && 50 && 50 \\
\bottomrule
\end{tabular}

关于r - 比较回归模型与 R,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10602915/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com