Robust models and defining intervals & list files

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

Robust models and defining intervals & list files

Postby Miguel » Mon Jul 19, 2010 8:26 pm

I was hoping someone could help me with two sintax questions about robust models RMark.

1. I’m trying to duplicate the rd_simple.inp example from Chapter 15 in RMark but I’m having difficulty specifying time intervals in the process.data statement. I was wondering what the syntax is. I tried:

rd_simple=convert.inp("C:/Users/Owner/Desktop/markdata/rd_simple1.inp")
time.intervals=c(0,0,1,0,0,1,0,0,1,0,0)
rd_simple.processed=process.data(rd_simple,model="Robust", time.intervals)

but I got the message:

Error in process.data(rd_simple, time.intervals, model = "Robust") :
ime intervals must be specified for a robust design

2. I was also wondering how I might be able to define a list such as time.intervals, or covariate with a link to a file such as (C:\Documents\time.intervals…). This would be convenient with very large data set.

Thank you for your help.
Miguel
 
Posts: 26
Joined: Thu Mar 10, 2005 11:18 am
Location: University of Miami

Re: Robust models and defining intervals & list files

Postby jlaake » Mon Jul 19, 2010 9:54 pm

Miguel-

You need to spend a little more time learning R. When you specify arguments to a function in R it can be done by position or by arg=value. If you do it by position you need to specify a value for each argument in their order. You can also mix order and arg=value. What is usually done is to specify the first 1 to 3 arguments by order and then the rest are done by arg=value. So in this case, what you wrote would work if time.intervals was the 3 argument but it is not so what you need is:

rd_simple.processed=process.data(rd_simple,model="Robust", time.intervals=time.intervals)

With regard to your second question, you can read the time intervals in from a file and assign to a vector and then use that vector as the value to the time.intervals argument. But you need to use a vector and not a list. vectors and lists are very different structures in R.

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

Re: Robust models and defining intervals & list files

Postby Miguel » Tue Jul 20, 2010 8:26 pm

Jeff,

Thank you for your quick reply, it helped me last night. Yes you are right and I am trying to get the hang of R.

Thanks a lot once again,
Miguel
Miguel
 
Posts: 26
Joined: Thu Mar 10, 2005 11:18 am
Location: University of Miami


Return to RMark

Who is online

Users browsing this forum: No registered users and 1 guest