Hi everyone,
I have a tiny problem in R which makes code generation longer, and interpretation of results more painful.
It looks as though I have to tell R that the content of variables in my (panel) dataframe are numbers (by using as.numeric
; and even to tell it to look into my df by using df$
in front of the variable of interest.
Thus, I have to write all my functions as
panelivmodel = plm(as.numeric(dataset1$logHealthExpPC) ~
as.numeric(dataset1$program) + as.numeric(dataset1$BA2TOT) +
lag(as.numeric(dataset1$logGDPpc),1) +
lag(as.numeric(dataset1$lognetODApc),1) +
lag(as.numeric(dataset1$democracy),1) +
as.numeric(dataset1$dependency_total) + as.numeric(dataset1$urbanpop) + as.numeric(dataset1$conflict),
data = dataset1, effect = "twoways")
when I would like to write
panelivmodel = plm( logHealthExpPC ~ program + BA2TOT +
lag(logGDPpc,1) + lag(lognetODApc),1) +
lag(as.numeric(dataset1$democracy,1) +
dependency_total + urbanpop +
conflict, data = dataset1, effect = "twoways")
The thing is, in the second case, R does not even seem to notice plm
is a function that expects arguments in it; when I type something (e.g. effect
) it suggests me the effects
function, instead of the effect
*argument