Error in effect.default…argument “offset” is missing, with no default

Multi tool use
Multi tool use


Error in effect.default…argument “offset” is missing, with no default



I'm looking to plot the effects for a TOBIT regression model at -1SD and +1SD using a bar graph. I would normally use a line graph, but my co-authors have asked for a bar graph instead. I have had some help identifying what I should do here, but I am getting an error that no one seems to be able to figure out.



Creating dataframe - this runs fine.


tobitforgraph <- survreg(Surv(S1, S2, type='right') ~ +(Var1centered)*Var2centered*Var3standardized,data=Datafilename, dist='gaussian', robust=TRUE))



Load effects library.


library(effects)



Extract values for plotting (the values coming from here are then supposed to be used to plot as normal in Excel, although there may be a way to do it in R; regardless, this is where I am getting an error).


print((intplot<-as.data.frame(ef< Effect(c("Var1centered","Var3standardized"),mod=tobitforgraph,xlevels=list(Var1centered=c(-.4987531,.5012469),Var3standardized=c(-1.0,1.0), data=subset(Datafilename, Var4==-0.5025))))))



Error that comes from this value extraction:


Error in Effect.default(c("Var1centered", "Var3standardized"), mod = tobitforgraph, :
argument "offset" is missing, with no default





Welcome to SO! The print call with an attribution (intplot <- ) is a bit odd. Could you dput(tobitforgraph) and post the result here, so it'd be reproducible?
– csgroen
Mar 23 at 19:15


print


dput(tobitforgraph)





@csgroen Thank you for the welcome and for the response! I've run it and have the data, although it's too long to fit in a comment here. I'll see if there's a way to post that condensed, or else will post in multiple comments.
– J. Smith
Mar 23 at 19:36






Maybe dput(head(tobitforgraph))
– csgroen
Mar 23 at 19:41


dput(head(tobitforgraph))





That's better, although still 10,000 characters over limit (yikes!).
– J. Smith
Mar 23 at 19:45





How about dput(head(Datafilename))?
– csgroen
Mar 23 at 19:48


dput(head(Datafilename))









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

U7TpkG4KkPG,Ip,5xdr Xp,A,uXK,iHIn
9QrEADefjpBB9QjwFO6EDGZrfj4I WvvreSz,FUYdDi9 pmyhN8bnzNvIiCHLQ,e1xp,O,Ho6,E9E R9QXRXfcmauE aTbOZ

Popular posts from this blog

PySpark - SparkContext: Error initializing SparkContext File does not exist

django NoReverseMatch Exception

List of Kim Possible characters