r - Keeping a constant column in plm -


in panel data frame need keep constant column of 1 s. after converstion data.frame pdata.frame column of 1s gets dropped automatically. there way can keep column?

next being dropped, there message indicating it's constant.

> xy <- data.frame(a = runif(5), b = runif(5), c = 1) > pdata.frame(xy, drop.index = false) series c constant , has been removed                                                                        b 0.0236744922585785-0.950130922021344 0.0236744922585785  0.950130922021344 0.0879391168709844-0.295759258326143 0.0879391168709844  0.295759258326143 0.501141534885392-0.737975958967581   0.501141534885392  0.737975958967581 0.715363236144185-0.425528935389593   0.715363236144185  0.425528935389593 0.982470828806981-0.0960431189741939  0.982470828806981 0.0960431189741939 

this behavior hard coded pdata.frame function.

 if (length(cst.serie) > 0) {         if (length(cst.serie) == 1) {             cat(paste("series ", cst.serie, " constant , has been removed\n",                  sep = ""))         }         else {             cat(paste("series ", paste(cst.serie, collapse = ", x"),                  " constants , have been removed\n", sep = ""))         }     } 

you can either e-mail package maintainer or remove bit (by creating second function). assuming there theoretical grounds keeping/not keeping constants.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -