robust design and no movement

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

robust design and no movement

Postby amandarg4 » Wed Jan 15, 2020 10:08 pm

I am running a robust design model and my code for no movement appears to not be correct as Gamma Prime is not fixed to 0. What am I doing wrong?

Code: Select all
buckrd <- convert.inp("d:/RD_buckA.inp",
                    covariates = c("spec2", "sex", "trt2"))

buckrd$spec2 <- factor(buckrd$spec2,
                     levels = c(0, 1),
                     labels = c("msp","pman"))
buckrd$sex  <- factor(buckrd$sex,
                    levels = c(0, 1),
                    labels = c("female", "male"))                     
buckrd$trt2  <- factor(buckrd$trt2,
                     levels = c(0, 1),
                     labels = c("placebo", "vaccine"))
#Robust
buckrd.process=process.data(data=buckrd,model="Robust", time.intervals=c(0,0,0,0,0.867,0,0,0,0,0.767,0,0,0),
                            groups=c("sex","spec2","trt2"))

#add 2 age bins
buckrd.ddl=make.design.data(buckrd.process)
buckrd.ddl=add.design.data(buckrd.process,buckrd.ddl,parameter="S",type="age",
                         bins=c(0,.5,3),name="tages")
buckrd.models=function()
{
  #survival
  S.tages.adtrt2=list(formula=~tages+trt2)
  S.spec2.trt2=list(formula=~spec2*trt2)
  S.trt2=list(formula=~trt2)
  S.spec2.adtages=list(formula=~spec2+tages)
  S.spec2=list(formula=~spec2)
  S.tages=list(formula=~tages)
  S.null=list(formula=~1)
 
  #Gamma
  #random
  GammaDoublePrime.random=list(formula=~1,share=TRUE) # gamma' = gamma''
#random time
 GammaDoublePrime.randomt=list(formula=~time,share=TRUE)
  #no emigration
  GammaDoublePrime.dot=list(formula=~1,share=TRUE,fixed=0) # gamma'=gamma''=0
 
  p.null=list(formula=~1)
  p.sex=list(formula=~sex, share=TRUE)
  p.time=list(formula=~time, share=TRUE)
  p.tages=list(formula=~tages, share=TRUE)
  p.spec2=list(formula=~spec2, share=TRUE)
  p.trt2=list(forumala=~trt2, share=TRUE)
  p.session=list(forumala=~session, share=TRUE)

  cml=create.model.list("Robust")
  results=mark.wrapper(cml,data=buckrd.process,ddl=buckrd.ddl)
  return(results)
}

buckrd.results=buckrd.models()


Thank you
amandarg4
 
Posts: 1
Joined: Sun Aug 28, 2016 11:43 pm

Re: robust design and no movement

Postby jlaake » Thu Jan 16, 2020 3:58 pm

I can't see anything obviously wrong
You are welcome to send me code and some data and I'll look at it. jefflaake@gmail.com Or you can try splitting off that model in a separate run and create a variable named fix in the design data for both gammas and set all values to 0.
jlaake
 
Posts: 1417
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: robust design and no movement

Postby jlaake » Wed Jan 22, 2020 7:23 pm

As it turns out this question has been posted before. See http://www.phidot.org/forum/viewtopic.php?f=21&t=3053&p=9823&hilit=fix+share#p9811. I knew it seemed vaguely familiar but it was awhile back. Here is what I suggested to Amanda to use:

Code: Select all
  GammaDoublePrime.dot=list(GammaDoublePrime=list(formula=~1,fixed=0),GammaPrime=list(formula=~1,fixed=0)) # gamma'=gamma''=0


Instead of using share=T and fixed=0 you have to specify a list containing both formula being fixed to 0 and it gets the name of one of the parameters for create.model.list. She was using GammaDoublePrime which is the dominant parameter in the pair.

--jeff
jlaake
 
Posts: 1417
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA


Return to RMark

Who is online

Users browsing this forum: No registered users and 13 guests