Hello R-Users,
I have the following problem with the subset function:
See the following simple linear model. Here everything works fine:
>germany<-lm(RENT~AGE1, in.mi01)
However, if a use the same regression equation and only specify a subset, I
get an error message:
> berlin<-lm(RENT~AGE1, in.mi01, subset=C_X01=="Berlin")
Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
0 (non-NA) cases
The datasets contains no missing values and for the city Berlin there are
2200 observations.
> summary(in.mi01$C_X01)
Berlin Düsseldorf Frankfurt am Main Hamburg
Köln
2200 1638 2943
2068 759
Leipzig Munich Others Stuttgart
344 1514 7955
383
What am I doing wrong?
Thanks in advance for any help and suggestions,
Simon
[[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.