2012-11-27 6 views
1

stargazer 패키지를 사용하여 회귀 결과 테이블을 만들려고합니다. 불행히도 stargazer는 특이점 때문에 테이블 만들기를 거부합니다. 이러한 특이점은 여러 단계로 중첩되는 요소에서 비롯되므로 쉽게 피할 수 없습니다. 때문에 singularites의특이점이있는 모델의 경우 stargazer()

library(sandwich) 
library(stargazer) 
set.seed(101) 
dat<-data.frame(one=c(sample(1000:1239)), 
      two=c(sample(200:439)), 
      three=c(sample(600:839)), 
      Jan=c(rep(1,20),rep(0,220)), 
      Feb=c(rep(0,20),rep(1,20),rep(0,200)), 
      Mar=c(rep(0,40),rep(1,20),rep(0,180)), 
      Apr=c(rep(0,60),rep(1,20),rep(0,160)), 
      May=c(rep(0,80),rep(1,20),rep(0,140)), 
      Jun=c(rep(0,100),rep(1,20),rep(0,120)), 
      Jul=c(rep(0,120),rep(1,20),rep(0,100)), 
      Aug=c(rep(0,140),rep(1,20),rep(0,80)), 
      Sep=c(rep(0,160),rep(1,20),rep(0,60)), 
      Oct=c(rep(0,180),rep(1,20),rep(0,40)), 
      Nov=c(rep(0,200),rep(1,20),rep(0,20)), 
      Dec=c(rep(0,220),rep(1,20))) 
model <- lm(one ~ two + three + Jan + Feb + Mar + Apr + May + Jun + Jul + Aug + Sep + Oct + Nov + Dec, data=dat) 
summary(model) 
stargazer(model) 

내가 오류를 얻을 : 첨자가 범위 외에있는 것은 이것이 왜 내가 대체 솔루션 여기
을 찾고하는 작업 예를 adapted from a related thread에게 있습니다. 이 문제를 해결하는 방법에 대한 아이디어가 있습니까?

답변

1

이 문제는 해결되었습니다. 최신 버전의 사용자 (3.0)는 예제에 문제가 없어야합니다.