fixed effects r

hi here is my code

plm(years_alive ~ happy_binary, data = humans, index = c("location"), model = "within"))

im trying to see how whether if you are happy or not impacts ur life span. im controlling for location fixed effects with model "within". my issue is this error:

Error in (function (.. row.names = NULL, check.rows = FALSE, check.names = TRUE, : 
arguments imply differing number of rows: 1,0

this is confusing since there is no NA in "location" , "years_alive", and "happy_binary". any idea what I can do to fix this. :frowning: thank you !!!. I dont get this error when using regular regression

Hi, can you provide a reproducible example of your dataset?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.