Get.real error message

posts related to the RMark library, which may not be of general interest to users of 'classic' MARK

Get.real error message

Postby Lconcannon » Mon Aug 19, 2013 10:50 am

Hi
I just have a couple of questions:
1) I am trying to plot the estimates from my top model and having some difficulties. Firstly I have had trouble getting the output (real paras) to 'match' up to my design data (I have 3 age bins), so from searching the forum I read that:
Code: Select all
summary(results[[16]],se=TRUE)$reals

Would associate the ddl with the real parameters, but I get the following error message:
Code: Select all
Warning messages:
1: In get.real(model, parameter.names[i], se = se, show.fixed = show.fixed) : 
Improper V-C matrix for beta estimates. Some variances non-positive.
2: In get.real(model, parameter.names[i], se = se, show.fixed = show.fixed) : 
Improper V-C matrix for beta estimates. Some variances non-positive

Is this just due to having estimates at the boundaries? Or should I worry about it?

2) I then want to plot the estimates for Phi with the upper and lower CL, I have done plots in R before, but I can't translate the info in the help file for "get.real" to my analysis, have also checked the manual. Is there any more example code for creating plots using get.real that you can point me to so I can try and apply this to my analysis please?

Thanks

Lianne
Lconcannon
 
Posts: 12
Joined: Wed Feb 06, 2013 6:35 am

Re: Get.real error message

Postby jlaake » Mon Aug 19, 2013 12:06 pm

The message is simply a warning that the var-cov matrix estimates for some parameters are not good. Typically due to boundary parameters.

Not sure what problem you are having with plotting get.real. For any parameter it returns a value for each possible real parameter. The design data it returns is the default design data and doesn't include the added design data. Because you can delete design data it cannot assume that it will all be there. You'll have to create your age bins with the data that it returns. The function cut should work. The following is an example that fits dipper data and gets the reals for Phi. There are 42 possible real parameters - 21 for each sex.

Code: Select all
data(dipper)
dp=process.data(dipper,groups="sex")
ddl=make.design.data(dp)
ddl$Phi$age1=cut(ddl$Phi$Age,0:6,include.lowest=T)
mod=mark(dp,ddl,model.parameters=list(Phi=list(formula=~time),p=list(formula=~sex)),groups="sex")
R=get.real(mod,"Phi",se=T)
with(R[R$sex=="Male"&R$cohort==1,],{
   plot(Time,estimate,type="b",ylim=c(0,1),ylab="Survival")
   lines(Time,lcl,ylim=c(0,1),lty=2)
   lines(Time,ucl,ylim=c(0,1),lty=2)
})

jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Get.real error message

Postby Lconcannon » Thu Aug 22, 2013 6:12 am

Thanks Jeff, that really helps.

Lianne
Lconcannon
 
Posts: 12
Joined: Wed Feb 06, 2013 6:35 am


Return to RMark

Who is online

Users browsing this forum: No registered users and 1 guest

cron