Dear R-Users,
I used the box.tidwell () function of the car Package.
When I used the following formula:
semi.sub.in.mi1.boxtidwell_h<-box.tidwell(RENT_LG ~ I(age+1)+I(age2+1)+X06A
+ I(X08B+1) + I(X22+1) + I(X24+1) + X31A, ~B_YEAR + C_X01 + C_X14 + C_X19 +
C_X29A +C_X21 + C_X23 + D_X12 + D_X17 + D_X18 + D_X25 + D_X27 + D_X30 +
D_X32 + D_X35, data = semi.sub.in.mi1)
everything is fine.
However, when I replaced the time dummy variable:
semi.sub.in.mi1.boxtidwell_h<-box.tidwell(RENT_LG ~ I(age+1)+I(age2+1)+X06A
+ I(X08B+1) + I(X22+1) + I(X24+1) + X31A, ~B_HALF + C_X01 + C_X14 + C_X19 +
C_X29A +C_X21 + C_X23 + D_X12 + D_X17 + D_X18 + D_X25 + D_X27 + D_X30 +
D_X32 + D_X35, data = semi.sub.in.mi1)
I get the following error message:
Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
NA/NaN/Inf in foreign function call (arg 1)
When I use the following formula (I deleted the I(age2+1) term):
semi.sub.in.mi1.boxtidwell_h<-box.tidwell(RENT_LG ~ I(age+1)+X06A +
I(X08B+1) + I(X22+1) + I(X24+1) + X31A, ~B_HALF + C_X01 + C_X14 + C_X19 +
C_X29A +C_X21 + C_X23 + D_X12 + D_X17 + D_X18 + D_X25 + D_X27 + D_X30 +
D_X32 + D_X35, data = semi.sub.in.mi1)
It works.
Some background information:
- The formula with the predictors to be transformed contains only
variables which are >0.
- The data set does not have any missing values
- B_YEAR is a factor with 10 levels
- B_HALF is a factor with 20 levels
- The data set contains more than 19000 observations.
Now, I am bit confused. Why does the function works when I use B_YEAR
respecitvely why does it work with B_HALF when I delete I(age2+1)
Thanks in advance,
Simon
Simon P. Kempf
Dipl.-Kfm. MScRE Immobilienökonom (ebs)
Wissenschaftlicher Assistent
Büro:
IREBS Immobilienakademie
c/o ebs Immobilienakademie GmbH
Berliner Str. 26a
13507 Berlin
Privat:
Dunckerstraße 60
10439 Berlin
Mobil: 0176 7002 6687
Email: <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.