Page 1 of 1

Error in names(design.matrix[i])

PostPosted: Fri Nov 06, 2015 3:54 pm
by tasha
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!

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

PostPosted: Mon Nov 09, 2015 8:01 pm
by jlaake
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

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

PostPosted: Thu Nov 19, 2015 4:56 pm
by tasha
Thank you, we got it figured out :D