I am running the summary(lm(...)) function in R. When I print the coefficients I get estimates for all variables except the last variable. The last variable I get "NA".

I tried switching the last column of data with another column and again, whatever was in the last column got "NA", but everything else got estimates.

A little bit about the data: I have about 5 variables with data in every row and then I have 12 seasonal variables that, for example, if the month is january there is a 1 for every day in january, 0 otherwise. For february variable there is a 1 if month is february and 0 otherwise and so on. Does anyone know what would produce "NA" in the last column of the coefficient estimate? So the first time I ran it, it was the coefficient for the December dummy variable. Is it because of my monthly dummy variables? Thanks

This is my reproducible example.

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)
      )

attach(dat)

summary(lm(one ~ two + three + Jan + Feb + 
          Mar + Apr + May + Jun + Jul + Aug + Sep + Oct + Nov + Dec))
r
Edit
Report