RMark - trouble adding design data covariate

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

RMark - trouble adding design data covariate

Postby pupfish » Thu Feb 21, 2008 1:13 pm

Greetings all,

I am fairly new to RMark (have been using MARK) and can't seem to be able to add a design covariate (ie water flow (CFS) for each time of capture). I have 16 capture occasions - thus 15 values for time.interval. I keep getting the error listed below. Does anyone have any ideas? I have read the Appendix C.6.(pg C-31) and the help file for merge.occasion.data numerous times but to no avail - I can run the dipper example, and have set up my code similarly. Am I missing something? I have tried running it by dropping the first values leaving 15 values for flow and the time (in the data.frame), and I get the same error. Any help would be appreciated.


> flow<-c(5.83, 1.96, 1.64, 0.15, 17.5, 16.1, 13.6, 11.5, 21.2, 15.3, 3.54, 3.68, 3.65, 5.38, 5.71, 5.91) #=CFS per sampling occasion, 16 values

> ltime<-c(29,2,26,49,1,7,1,13,1,42,1,1,25,1,1) #lengths of time between capture occasions, 15 values

> t<-c(0,29,2,26,49,1,7,1,13,1,42,1,1,25,1,1) # time component for flow covariate 16 values

> sp<- convert.inp("nov.inp", group.df=data.frame(sex=c("female","male")), covariates=c("length"), use.comments=TRUE)

> m<- process.data(sp,model="CJS", begin.time=127, time.intervals=c(ltime),groups="sex") #begin.time=day of yer

> sp.ddl=make.design.data(m)
> df=data.frame(time=c(t),cfs=c(flow))
> sp.ddl=merge.occasion.data(m, sp.ddl,"Phi",df)


Error in merge.occasion.data(m, sp.ddl, "Phi", df) :
df does not contain a time value for each time in design data


> list (df)
[[1]]
time cfs
1 0 5.83
2 29 1.96
3 2 1.64
4 26 0.15
5 49 17.50
6 1 16.10
7 7 13.60
8 1 11.50
9 13 21.20
10 1 15.30
11 42 3.54
12 1 3.68
13 1 3.65
14 25 5.38
15 1 5.71
16 1 5.91
pupfish
 
Posts: 3
Joined: Tue Feb 19, 2008 7:17 pm
Location: Tucson

Problem with time covariate in RMark

Postby jlaake » Tue Feb 26, 2008 5:50 pm

For some reason I didn't get the email for this posting. If you haven't heard from me or someone else in a day or so with an RMark posting, please send a message directly to me at jeff.laake@noaa.gov

The time values in df are actual time values and not values of time intervals. They must match what is in the design data. You can see what those are by typing:

sp.ddl$Phi$time

You used begin.time=127 so the time values should be 127 and greater. What you used in df$time range from 0 to 49 and are intervals rather than actual times. Change it so they match and it should work fine.

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

RMark - trouble adding design data covariate

Postby pupfish » Fri Feb 29, 2008 5:12 pm

Thanks, it works. I new it was something simple that I was missing.

Much obliged,

cheers
pupfish
 
Posts: 3
Joined: Tue Feb 19, 2008 7:17 pm
Location: Tucson


Return to RMark

Who is online

Users browsing this forum: No registered users and 12 guests

cron