Bivariate threshold model with 2 different thresholds

1 reply [Last post]
Havinginsight's picture
Offline
Joined: 07/11/2011

Hello!
I'm trying to run a bivariate model to estimate ACE for autism and social skills. Autism has 1 threshold and social skills 5.
Do I need to specify both thresholds for the model? At the moment the script I've adapted does not do that. However, it doesn't run and returns the following error message:
"twinSat' exited abnormally with the error message: Objective function returned a value of NaN at iteration 0.1."

I want the threshold for diagnosis of autism to be above 2.3 score cut off point.
It has been pointed out to me that I am not setting the values right, but after trying different starting values and increments I still get the same error message.

Could anyone help, pretty please!??

MANY THANKS IN ADVANCE.

Bea

AttachmentSize
Bivariate_ASD_SK_Forum.R4.73 KB
asdtrainingfile.dat20.11 KB
neale's picture
Offline
Joined: 07/31/2009
Hmmm

I thought I had it - matrix Low1 should be declared as Lower, not Full. Having fixed that and mxRun with unsafe=T it still fails. The covariance matrices look positive definite, the thresholds are in order, means are zero... I am a bit stuck too, will think about it. But do make the change to Low1. Oh, now I see. You need to mxFactor the ASD variable to have only two levels. However, it then becomes a problem that the expected correlation matrix of the MZ's can go negative definite (because you've individually estimated the correlations). I think you may need to head to Cholesky land or similar in order to constrain the correlation matrix to stay positive definite.

Running twinSat 
Warning message:
The job for model 'twinSat' exited abnormally with the error message: Objective function returned a value of NaN at iteration 17.18. 
> twinSatSumm 	<- summary(twinSatFit)
> round(twinSatFit@output$estimate,4)
           r12 MZ.Block2[1,2] MZ.Block2[2,2]            tv2            i12            i22            i32            i42 DZ.Block3[1,2] 
        0.4931         0.2586         0.7268        -0.6886         0.5972         0.4923         0.5832         0.5892         0.1209 
DZ.Block3[2,2] 
        0.5041 
> twinSatSumm
data:
$MZ.data
   ASD1      SSP1      ASD2      SSP2   
 0   :32   0   : 8   0   :32   0   : 9  
 1   :20   1   : 8   1   :20   1   :11  
 NA's: 2   2   : 4   NA's: 2   2   : 5  
           3   : 8             3   : 9  
           4   : 7             4   : 3  
           5   : 9             5   : 7  
           NA's:10             NA's:10  
 
$DZ.data
   ASD1      SSP1      ASD2      SSP2   
 0   :86   0   :19   0   :96   0   :19  
 1   :54   1   :15   1   :44   1   :22  
 NA's:11   2   :27   NA's:11   2   :20  
           3   :19             3   :20  
           4   :20             4   :22  
           5   :20             5   :18  
           NA's:31             NA's:30  
 
free parameters:
             name        matrix row col   Estimate     Std.Error lbound ubound
1             r12 MZ.expCorPhmz   1   2  0.4930889 8.487983e-314  -0.99   0.99
2  MZ.Block2[1,2]     MZ.Block2   1   2  0.2586425           NaN  -0.99   0.99
3  MZ.Block2[2,2]     MZ.Block2   2   2  0.7267790           NaN  -0.99   0.99
4             tv2     MZ.V2thmz   1   1 -0.6886430           NaN     -4       
5             i12     MZ.V2thmz   2   1  0.5972055 4.243992e-314  0.001       
6             i22     MZ.V2thmz   3   1  0.4923450           NaN  0.001       
7             i32     MZ.V2thmz   4   1  0.5831866           NaN  0.001       
8             i42     MZ.V2thmz   5   1  0.5891707           NaN  0.001       
9  DZ.Block3[1,2]     DZ.Block3   1   2  0.1208841           NaN  -0.99   0.99
10 DZ.Block3[2,2]     DZ.Block3   2   2  0.5041306 3.458460e-323  -0.99   0.99
 
observed statistics:  713 
estimated parameters:  10 
degrees of freedom:  703 
-2 log likelihood:  NaN 
saturated -2 log likelihood:  NA 
number of observations:  205 
chi-square:  NaN 
p:  NaN 
Information Criteria: 
     df Penalty Parameters Penalty Sample-Size Adjusted
AIC:        NaN                NaN                   NA
BIC:        NaN                NaN                  NaN
CFI: NA 
TLI: NA 
RMSEA:  NA 
timestamp: 2012-10-17 16:42:20 
frontend time: 0.1406462 secs 
backend time: 0.2088509 secs 
independent submodels time: 2.908707e-05 secs 
wall clock time: 0.3495262 secs 
cpu time: 0.3495262 secs 
openmx version number: 999.0.0-2174 
 
> 
> 
> &&&&&&&&&&&&&&&&
Error: unexpected '&&' in "&&"
> twinSatFit$MZ.expCorMZ
mxAlgebra 'expCorMZ' 
@formula:  rbind(cbind(expCorPhmz, Block2), cbind(Block2, expCorPhmz)) 
@result:
          [,1]      [,2]      [,3]      [,4]
[1,] 1.0000000 0.4930889 0.8000000 0.2586425
[2,] 0.4930889 1.0000000 0.2586425 0.7267790
[3,] 0.8000000 0.2586425 1.0000000 0.4930889
[4,] 0.2586425 0.7267790 0.4930889 1.0000000
dimnames: NULL
> twinSatFit$DZ.expCorDZ
mxAlgebra 'expCorDZ' 
@formula:  rbind(cbind(expCorPhdz, Block3), cbind(Block3, expCorPhdz)) 
@result:
          [,1]      [,2]      [,3]      [,4]
[1,] 1.0000000 0.4930889 0.4000000 0.1208841
[2,] 0.4930889 1.0000000 0.1208841 0.5041306
[3,] 0.4000000 0.1208841 1.0000000 0.4930889
[4,] 0.1208841 0.5041306 0.4930889 1.0000000
dimnames: NULL
> eigen(twinSatFit$MZ.expCorMZ@result)
$values
[1]  2.5160118430  1.0107671725  0.4738982179 -0.0006772334
 
$vectors
           [,1]       [,2]       [,3]       [,4]
[1,] -0.5120166 -0.4876874 -0.4598132  0.5371888
[2,] -0.4876874  0.5120166 -0.5371888 -0.4598132
[3,] -0.5120166 -0.4876874  0.4598132 -0.5371888
[4,] -0.4876874  0.5120166  0.5371888  0.4598132
 
> eigen(twinSatFit$DZ.expCorDZ@result)
$values
[1] 2.0682420 0.9237634 0.8358886 0.1721060
 
$vectors
           [,1]       [,2]       [,3]       [,4]
[1,] -0.4784095 -0.5335107  0.5206960  0.4640758
[2,] -0.5206960 -0.4640758 -0.4784095 -0.5335107
[3,] -0.4784095  0.5335107  0.5206960 -0.4640758
[4,] -0.5206960  0.4640758 -0.4784095  0.5335107

AttachmentSize
Bivariate_ASD_SK_Forum.R 4.85 KB