質問

Is it possible to omit interactions in stargazer using the omit option? Normally I would write the variable name into the omit=c('varname') but in the case of an interaction I do not know what to write. Any hints on that? How do you solve this problem in other packages like xtable?

\documentclass{article}   
\begin{document}   
%Load dataset and run regression    

 << lm, echo=FALSE >>=   
 load('dataset.RData')  
 library(stargazer)  
 lm1 <- lm(y~ x + factor(v)*z ,data=dataset)  
 @


 << table_texstyle, echo=FALSE, comment=NA, results='asis' >>=  
 stargazer(lm1 ,omit=c('???'), omit.labels=c('Omitted interactions'),
      omit.yes.no = c("Yes", "No")))  
  @  
   \end{document}
役に立ちましたか?

解決

If you want to omit all interactions, try

stargazer(m1, omit = ":")

This works because omit argument is expecting a regular expression. This is a very powerful tool when filtering strings. See ?regexpr or browse the regex tab here on Stackoverflow.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top