Re: [R] factor() in lm

2013-12-01 Thread Gary Dong
Thanks, Bert. It seems I got these NAs because I already had MSA population controlled for in my model, besides the fixed effect variable, which led to overestimation. Those NAs disappeared after I dropped the population variable. Gary On Sun, Dec 1, 2013 at 10:27 AM, Bert Gunter wrote: > You

Re: [R] factor() in lm

2013-12-01 Thread Bert Gunter
You may wish to talk to a local statistician or read up on linear models, as you appear to not understand some basics. Anyway, either 1. You have other covariates in your model that you haven't shown and your model is overdetermined. 2. You have NA's in your data that causes 1) to occur. As an e

[R] factor() in lm

2013-12-01 Thread Gary Dong
Dear R users, I am running a linear regression in R. My observations are Census Tracts in several metropolitan areas (MSAs). In my data set, each MSA has at least 50 observations. I use factor(msa_code) in the lm formula to control for metropolitan fixed effects. But I kept getting something like