Displaying 2 results from an estimated 2 matches for "ofst".
Did you mean:
ofs
2008 Apr 04
2
predict.glm & newdata
Hi all -
I'm stumped by the following
mdl <- glm(resp ~ . , data = df, family=binomial, offset = ofst) WORKS
yhat <- predict(mdl) WORKS
yhat <- predict(mdl,newdata = df) FAILS
Error in drop(X[, piv, drop = FALSE] %*% beta[piv]) :
subscript out of bounds
I've tried without offset, quoting binomial. The offset variable ofst IS in df.
Previous postings indicate possible names(df) prob...
2010 Jan 16
2
predict.glm
...=predict(reg1) ##prediction works fine
yhat=predict(reg1,newdata=x2) ##gives error message because of "newdata"
>Error in eval(predvars, data, env) :
numeric 'envir' arg not of length one
yhat=predict(reg1,data=x2) ##works fine
##using offset
ofst=rep(0.5,100)
reg1=glm(y1~x1,binomial,offset=ofst)
yhat=predict(reg1)
yhat1=predict(reg1,newdata=x2) ##gives error message
yhat2=predict(reg1,data=x2) ##works fine
% ========================================...