The optimal model is fit in a case where aside from some parameters, the model is linear. Numerical optimization is used over these parameters with stats::lm()() fitting the rest.

plm(formula, data = parent.frame(), params = c(), optimize = TRUE,
  .ocall = NULL, method = "nlm", ..., debug = FALSE)

Arguments

formula

a formula describing the model

data

a data frame

params

a named vector of the parameters to be fit by numerical optimation outside of stats::lm()().

optimize

a logical indicating whether params should be plugged in or used as the seed for the numerical optimization

.ocall

used for recursive calling

...

additional arguments, currently ignored.

Value

On object of class c("plm", "lm") which is an enhanced "lm" object.

Examples

if( require(EconData) & require(dplyr) ) { plm( log(iGDP) - log(iK) ~ iYear, data=Calvin %>% filter(Country=="US")) plm( log(iGDP) - delta * iK - (1-delta) * iL ~ iYear, data=Calvin %>% filter(Country=="US"), params=c(delta=0.4), optimize=FALSE ) plm( log(iGDP) - delta * iK - (1-delta) * iL ~ iYear, data=Calvin %>% filter(Country=="US"), params=c(delta=0.4), optimize=TRUE ) plm( log(iGDP) - delta * iK - (1-delta) * iL ~ iYear, data=Calvin %>% filter(Country=="US"), params=c(delta=0.4), method=c("nlm", "spg"), optimize=TRUE ) foo <- plm( log(iGDP / delta*(delta_1*iK + (1-delta_1)*iL) + (1-delta)*iQp) ~ iYear, data=Calvin %>% filter(Country=="US"), params=c(delta=0.5, delta_1=0.5)) foo class(foo) }
#> Loading required package: EconData
#> Warning: there is no package called ‘EconData’