Greetings to you all,
I am performing a semi parametric bootstrap in R on a Gamma Distributed
data and a Binomial distributed data. The main challenge am facing is
the fact that the residual variance depends on the mean (if am correct).
I strongly feel that the script below may be wrong due to mead variance
relationship
#####R code#######
fit1s <-glm(mydata$vzv~mydata$age.c+mydata$age2+mydata$sex1,
family=Gamma(link=log))
x.betahat1<-fit1s$fitted.values
res1<-fit1s$residuals
b<-1000
for (i in 1:b){
b.i <- sample(index, size=n, replace=T)
res.star1=res1[b.i]
bst1=x.betahat1+res.star1
mydata1 <-data.frame(age,age2,sex,bst1)
########Modeling ################
fit11 <-glm(bst1~age+age2+sex, family=Gamma(link=log),data=mydata1)
fit12<-glm(bst2~age+age2+sex, family=Gamma(link=log),data=mydata2)
}
Can someone help me correct this code? Kindly advice on Binomial data
as well
Happy New year
Polycarp
You may leave the list at any time by sending the command
SIGNOFF allstat
to [log in to unmask], leaving the subject line blank.
|