Help with TSSEM Problem encountered

Posted on
No user picture. Kwabenaaaddo Joined: 02/01/2021
Attachment Size
Data in CSV file 663.52 KB
TSSEM codes 2.94 KB

Dear Forum (Mike),

I have been working on a TSSEM using R and encountering the error below, which I do not know how to address. I would be grateful if you could help me proceed with your suggestions and diagnosis. I have attached the data and R codes for your perusal. 

Thank you so much for your help in advance.

Regards,

Kwabena.

Error:
> #### Running of Stage1 model
> stage1random <- tssem1(Cov=cordat, n=data$NUMBER.OF.BANKS, method="REM", RE.type="Diag")
> summary(stage1random)
Error in 1:(rsum * csum) : NA/NaN argument
In addition: Warning message:
In rsum * csum : NAs produced by integer overflow

Replied on Fri, 05/22/2026 - 09:53
Picture of user. AdminNeale Joined: Mar 01, 2013

Hi Kwabena

It seems that the number of banks is very large, and the Ns are too.  In particular, 

> pattern.n(cordat, data$NUMBER.OF.BANKS)
     A     B     C     D     E      F    G     H      I      J      K      L      M
A 40107  1160  1990   562  7395   2401  212   110  32738  10018   1174   2181  21420
B  1160 38462  3213  1087  6360   4280  212   362  30272  12692   4633   1553  15011
C  1990  3213 35496  2527  2898   2166   66    30  29131  13577   2337   3175  10920
D   562  1087  2527 33424  1820   1163   33    75  28039  15896   1878   1850  18458
E  7395  6360  2898  1820 90522  25454 1091  1664  68290  32573  18437  15652  44277
F  2401  4280  2166  1163 25454 128437 1459  3168 116760  37982  29447  14349  43101
G   212   212    66    33  1091   1459 8585  1783   5885   2322    429    501   3320
H   110   362    30    75  1664   3168 1783 12785  12272   4158    724     97   4536
I 32738 30272 29131 28039 68290 116760 5885 12272 587520 355681 270337  46350 464526
J 10018 12692 13577 15896 32573  37982 2322  4158 355681 419044  85388  26101 163423
K  1174  4633  2337  1878 18437  29447  429   724 270337  85388 285698  17235  29530
L  2181  1553  3175  1850 15652  14349  501    97  46350  26101  17235 171035 138945
M 21420 15011 10920 18458 44277  43101 3320  4536 464526 163423  29530 138945 480288

The row sums and column sums are the same as this matrix is symmetric.

These numbers, when processed, seem to be too large for representation as integers in R:

> rowSums(xx)
     A       B       C       D       E       F       G       H       I       J       K       L       M 
121468  119297  107526  106812  316433  410167   25898   41764 2047801 1178855  747247  439024 1437755 
> colSums(xx)
     A       B       C       D       E       F       G       H       I       J       K       L       M 
121468  119297  107526  106812  316433  410167   25898   41764 2047801 1178855  747247  439024 1437755 
> colSums(xx)*rowSum(xx)
Error in rowSum(xx) : could not find function "rowSum"
> colSums(xx)*rowSums(xx)
          A            B            C            D            E            F            G            H            I            J            K            L            M 
1.475448e+10 1.423177e+10 1.156184e+10 1.140880e+10 1.001298e+11 1.682370e+11 6.707064e+08 1.744232e+09 4.193489e+12 1.389699e+12 5.583781e+11 1.927421e+11 2.067139e+12 
> rsum <- sum(rowSums(xx))
> rsum^2
[1] 5.041067e+13
> is.integer(rsum^2)
[1] FALSE
> as.integer(rsum^2)
[1] NA
Warning message:
NAs introduced by coercion to integer range 

Mike Chung may have ideas here, but what I'm wondering is if the meta analysis could be done piecemeal, i.e., meta-analyze manageable subsets of the datasets until all are done, then meta-analyze the results of these multiple meta-analyses.  This is pure conjecture, I have no idea if this is a workable or suitable way out of your dilemma.  Usually, having too much data is a nice problem to have.