[R] betareg question - keeping the mean fixed?
betty_d
r_b_hamilton at yahoo.co.uk
Thu Sep 1 13:28:02 CEST 2011
Hello,
I have a dataset with proportions that vary around a fixed mean, is it
possible to use betareg to look at variance in the dispersion parameter
while keeping the mean fixed?
I am very new to R but have tried the following:
svec<-c(qlogis(mean(data1$scaled)),0,0,0)
f<-betareg(scaled~-1 | expt_label + grouped_hpi, data=data1, link.phi="log",
control=betareg.control(start=svec))
I understood that y~-1 could be used to give a fixed mean of 0.5 however I
get the following error:
Error in linkinv(x %*% beta + offset) :
Argument eta must be a nonempty numeric vector
I think I can work round this by using:
svec2<-c(qlogis(mean(data1$scaled)),0,0,0,0,0)
f2<-betareg(scaled ~ expt_label + grouped_hpi | expt_label + grouped_hpi,
data=data1,
+ link.phi="log",control=betareg.control(start=svec2))
This appears to work (ie doesn't return errors), but given i know the mean
to be fixed I would like to do this in the model (especially as my data set
is small) - is this possible?
Thanks in advance.
--
View this message in context: http://r.789695.n4.nabble.com/betareg-question-keeping-the-mean-fixed-tp3783303p3783303.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list