我用R的stargazer包想要输出回归分析的结果,代码为stargazer(fit1,fit2,fit3, title = "Results", align = TRUE),
但是R产生了以下结果:
% Table created by stargazer v.5.2.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu% Date and time: 周五, 四月 26, 2019 - 9:32:08% Requires LaTeX packages: dcolumn \begin{table}[!htbp] \centering \caption{Results} \label{} \begin{tabular}{@{\extracolsep{5pt}}lD{.}{.}{-3} D{.}{.}{-3} D{.}{.}{-3} } \\[-1.8ex]\hline \hline \\[-1.8ex] & \multicolumn{3}{c}{\textit{Dependent variable:}} \\ \cline{2-4} \\[-1.8ex] & \multicolumn{3}{c}{PH} \\ \\[-1.8ex] & \multicolumn{1}{c}{(1)} & \multicolumn{1}{c}{(2)} & \multicolumn{1}{c}{(3)}\\ \hline \\[-1.8ex] gender\_male & 0.868^{***} & 0.944^{***} & 0.850^{**} \\ & (0.316) & (0.348) & (0.367) \\ & & & \\ age & & -0.144^{***} & -0.141^{***} \\ & & (0.026) & (0.030) \\ & & & \\ married & & -0.313 & -0.353 \\ & & (0.431) & (0.450) \\ & & & \\ hukou\_rural & & & 0.447 \\ & & & (0.412) \\ & & & \\ education & & & 0.051 \\ & & & (0.048) \\ & & & \\ number\_friend & & & 0.013 \\ & & & (0.017) \\ & & & \\ exercise\_time & & & 0.007^{*} \\ & & & (0.004) \\ & & & \\ ln\_family\_income & & & 0.288^{**} \\ & & & (0.115) \\ & & & \\ Constant & 1.786^{***} & 11.964^{***} & 8.382^{***} \\ & (0.208) & (1.922) & (2.528) \\ & & & \\ \hline \\[-1.8ex] Observations & \multicolumn{1}{c}{477} & \multicolumn{1}{c}{477} & \multicolumn{1}{c}{477} \\ Log Likelihood & \multicolumn{1}{c}{-147.436} & \multicolumn{1}{c}{-129.987} & \multicolumn{1}{c}{-123.605} \\ Akaike Inf. Crit. & \multicolumn{1}{c}{298.873} & \multicolumn{1}{c}{267.973} & \multicolumn{1}{c}{265.210} \\ \hline \hline \\[-1.8ex] \textit{Note:} & \multicolumn{3}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ \end{tabular} \end{table}
然后,我将其粘贴到WinEdt10中,使用LaTeX运行,结果报错:
Command Line: xelatex.exe --interaction=errorstopmode --synctex=-1 "111.tex"
Startup Folder: C:\Users\Administrator\Desktop
xelatex: warning: running with administrator privileges
This is XeTeX, Version 3.14159265-2.6-0.999991 (MiKTeX 2.9.7000 64-bit)
entering extended mode
(111.tex
LaTeX2e <2018-12-01>
! LaTeX Error: Environment table undefined.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.3 \begin{table}
[!htbp] \centering
? X
No pages of output.
Transcript written on 111.log.
提示,Environment table undefined
我查了很多资料,但是依然没有解决这个问题。
请教大神!!!


雷达卡



京公网安备 11010802022788号







