This function will prepare p-values for stargazer based on the robust standard errors. Stargazer will do this automatically, so the main purpose of this function is to set the p-value of the intercept to 1. In experimental research, the intercept is often the sample mean for the control group and a test of the null hypothesis that it is equal to do is silly to report.

makerobustpslist(..., type = "HC2")

Arguments

...

a series of model fits, separated by commas

type

A string indicating the type of heterskedasticty-robust standard errors to be estimated. Is ignored if clust_var is specificed. Is "HC2" by default, because these are equivalent to Neyman standard errors (See Aronow and Samii).

Value

A list of vectors of robust standard errors.

Examples

library(randomizr) library(stargazer)
#> #> Please cite as:
#> Hlavac, Marek (2014). stargazer: LaTeX code and ASCII text for well-formatted regression and summary statistics tables.
#> R package version 5.1. http://CRAN.R-project.org/package=stargazer
Y_1 <- rnorm(100) Z_1 <- complete_ra(100) Y_2 <- rnorm(100) Z_2 <- complete_ra(100) fit_1 <- lm(Y_1 ~ Z_1) fit_2 <- lm(Y_2 ~ Z_2) stargazer(fit_1, fit_2, se = makerobustseslist(fit_1, fit_2), p = makerobustpslist(fit_1, fit_2))
#> #> % Table created by stargazer v.5.1 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu #> % Date and time: Tue, Jun 20, 2017 - 17:32:43 #> \begin{table}[!htbp] \centering #> \caption{} #> \label{} #> \begin{tabular}{@{\extracolsep{5pt}}lcc} #> \\[-1.8ex]\hline #> \hline \\[-1.8ex] #> & \multicolumn{2}{c}{\textit{Dependent variable:}} \\ #> \cline{2-3} #> \\[-1.8ex] & Y\_1 & Y\_2 \\ #> \\[-1.8ex] & (1) & (2)\\ #> \hline \\[-1.8ex] #> Z\_1 & 0.177 & \\ #> & (0.213) & \\ #> & & \\ #> Z\_2 & & 0.050 \\ #> & & (0.189) \\ #> & & \\ #> Constant & 0.079 & 0.0002 \\ #> & (0.143) & (0.115) \\ #> & & \\ #> \hline \\[-1.8ex] #> Observations & 100 & 100 \\ #> R$^{2}$ & 0.007 & 0.001 \\ #> Adjusted R$^{2}$ & $-$0.003 & $-$0.009 \\ #> Residual Std. Error (df = 98) & 1.066 & 0.945 \\ #> F Statistic (df = 1; 98) & 0.688 & 0.070 \\ #> \hline #> \hline \\[-1.8ex] #> \textit{Note:} & \multicolumn{2}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ #> \end{tabular} #> \end{table}