Error in names(design.matrix[i])

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

Error in names(design.matrix[i])

Postby tasha » Fri Nov 06, 2015 3:54 pm

Hello, I am trying to run an HCRDMS model and when I run the script for my first dataset, it runs fine, but when I run it for my second data set I get the following message:

Using default formula for c

S Psi p
1 S.aPt Psi.dot p.dot
2 S.aXt Psi.dot p.dot
3 S.season Psi.dot p.dot
4 S.t Psi.dot p.dot

S.aPt.Psi.dot.p.dot

Error in names(design.matrix[[i]]) = paste(names(parameters)[i], names(design.matrix[[i]]), :
'names' attribute [1] must be the same length as the vector [0]
Error in mark(model.parameters = model.parameters, initial = initial, :
Misspecification of model or internal error in code

As I have not been able to pick up on any discrepancies in the structure of the two datasets simply by eye, and I don't fully understand what the error message is telling me, I was wondering if anyone could suggest any diagnostic script I could run to help figure out what the problem may be with the second dataset.

Thank you!
tasha
 
Posts: 19
Joined: Thu Apr 01, 2010 9:37 pm

Re: Error in names(design.matrix[i])

Postby jlaake » Mon Nov 09, 2015 8:01 pm

It is hard to tell with the information you provided. RMark handles lots of different models and is quite general so the error messages you get are often a little oblique because ones like this are R messages because the condition was not anticipated. I'd have to look at your code and a snippet of data to help me understand. Do you always have at least 2 secondary occasions for each primary occasion? Is the RD structure the same for both data sets? Are the variables the same in each data set?

You can always type debug(mark) in your R session and then step through the code to see where the message is being generated. However, you have to be fairly adept at reading R code for this to be useful.

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

Re: Error in names(design.matrix[i])

Postby tasha » Thu Nov 19, 2015 4:56 pm

Thank you, we got it figured out :D
tasha
 
Posts: 19
Joined: Thu Apr 01, 2010 9:37 pm


Return to RMark

Who is online

Users browsing this forum: No registered users and 1 guest

cron