Conor Robinson
Conor Robinson

Reputation: 1

Error message when running panelAR package in R

"I am trying to use the panelAR package for a Panel Regression model with AR(1) correction and panel-corrected standard errors. The package has several arguments however when I run the model I receive an error "Error: The time variable must be defined as an integer". Even though the time variable "year" is st as an integer".

It's probably a simple fix but would appreciate any helpful advice. Thanks

data$year <-as.integer(data$year) data$area <-as.integer(data$area) str(data)

corrmodel <- panelAR(crmrte ~density+pctymle+pctclaims+rdcrte+antrte+pctleavFE+
                pctleavHE+pctleavEMP+pctleavUn, data= pdata, panelVar = "area", 
                timeVar = "year", autoCorr = "ar1", panelCorrMethod = "pcse",
                rhotype = "breg",bound.rho = FALSE,rho.na.rm = FALSE, 
                panel.weight = "t-1",dof.correction = FALSE,complete.case = FALSE,
                seq.times = FALSE, singular.ok=TRUE) 

R documentation

Upvotes: 0

Views: 185

Answers (1)

no_grammr
no_grammr

Reputation: 11

For posterity: Apparently panelAR doesn't like tibbles/tbl_df. Applying as.data.frame() to my input data set solved the issue as noted here: https://github.com/kkashin/panelAR/issues/2

Upvotes: 1

Related Questions