[R] predict.lqm
Nathan Pace
n.l.pace at utah.edu
Sat Dec 27 15:30:22 CET 2014
Hi,
I can estimate quantile regression models, but can¹t get the proper syntax
for the newdata argument in the predict.lqm function.
Specifically:
The model call
Des.Iso.ATE.lqm <- lqm(Wakeup.0.30 ~ Anesthetic,
data = Des.Iso.dt,weights = get.weights(Des.Iso.ATE.ps, stop.method =
'es.mean'),
tau = seq(0.1, 0.9, 0.1), control = list(loop_max_iter = 10000))
The explanatory factor Anesthetic is a two level.
Attempts to use predict
> predict(Des.Iso.ATE.lqm, newdata = data.table(Anesthetic = 'Iso'))
Error in predict.lqm(Des.Iso.ATE.lqm, newdata = data.table(Anesthetic =
"Iso")) :
object 'yhat' not found
> predict(Des.Iso.ATE.lqm, newdata = data.frame(Anesthetic = factor('Iso',
>levels=levels(Des.Iso.dt$Anesthetic))))
Error in predict.lqm(Des.Iso.ATE.lqm, newdata = data.frame(Anesthetic =
factor("Iso", :
object 'yhat' not found
???
Nathan
More information about the R-help
mailing list