# Re: st: se of tetrachoric correlation

 From Joseph Coveney To Statalist Subject Re: st: se of tetrachoric correlation Date Fri, 16 Jun 2006 02:31:52 +0900

```Janet Rosenbaum wrote:

Has anyone implemented a function in stata which estimates the standard
error of the tetrachoric correlation?
(e.g., Brown  MB. Algorithm AS 116: the tetrachoric correlation and its
standard error. Applied Statistics, 1977, 26, 343-351.)

--------------------------------------------------------------------------------

Yes.  Use -xtprobit- and examine rho's standard error.

Joseph Coveney

. clear

. set more off

. set seed `=date("2006-06-16", "ymd")'

. set obs 200
obs was 0, now 200

. forvalues i = 1/2 {
2. generate byte item`i' = uniform() > 0.5
3. }

. tetrachoric item*

Tetrachoric correlations (N=200)

----------------------------------
Variable |    item1     item2
-------------+--------------------
item1 |        1
item2 |    .1097         1
----------------------------------

. generate int row = _n

. reshape long item, i(row) j(column)
(note: j = 1 2)

Data                               wide   ->   long
-----------------------------------------------------------------------------
Number of obs.                      200   ->     400
Number of variables                   3   ->       3
j variable (2 values)                     ->   column
xij variables:
item1 item2   ->   item
-----------------------------------------------------------------------------

. xtprobit item column, i(row) intmethod(aghermite) intpoints(30) nolog

Random-effects probit regression                Number of obs      =
400
Group variable (i): row                         Number of groups   =
200

Random effects u_i ~ Gaussian                   Obs per group: min =
2
avg =
2.0
max =
2

Wald chi2(1)       =
0.01
Log likelihood  = -276.75842                    Prob > chi2        =
0.9174

------------------------------------------------------------------------------
item |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
Interval]
-------------+----------------------------------------------------------------
column |  -.0132835   .1281024    -0.10   0.917    -.2643597
.2377926
_cons |   .0265671   .2040708     0.13   0.896    -.3734043
.4265384
-------------+----------------------------------------------------------------
/lnsig2u |   -2.09337   1.127269                     -4.302775
.1160364
-------------+----------------------------------------------------------------
sigma_u |   .3510998   .1978919                      .1163226
1.059734
rho |   .1097429   .1101335                      .0133503
.5289766
------------------------------------------------------------------------------
Likelihood-ratio test of rho=0: chibar2(01) =     0.98 Prob >= chibar2 =
0.161

. xtprobit item column, i(row) intmethod(aghermite) intpoints(30)
vce(jackknife)
(running xtprobit on estimation sample)

Jackknife replications (200)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
..................................................    50
..................................................   100
..................................................   150
..................................................   200

Random-effects probit regression                Number of obs      =
400
Group variable (i): row                         Number of groups   =
200

Random effects u_i ~ Gaussian                   Obs per group: min =
2
avg =
2.0
max =
2

F(     1,     199) =
0.01
Log likelihood  = -276.75842                    Prob > F           =
0.9181

------------------------------------------------------------------------------
|              Jackknife
item |      Coef.   Std. Err.      t    P>|t|     [95% Conf.
Interval]
-------------+----------------------------------------------------------------
column |  -.0132835   .1290378    -0.10   0.918    -.2677406
.2411735
_cons |   .0265671   .2053563     0.13   0.897    -.3783866
.4315207
-------------+----------------------------------------------------------------
/lnsig2u |   -2.09337   1.132609                     -4.313243
.1265035
-------------+----------------------------------------------------------------
sigma_u |   .3510998   .1988294                      .1157154
1.065295
rho |   .1097429   .1106553                      .0132131
.5315838
------------------------------------------------------------------------------
Likelihood-ratio test of rho=0: chibar2(01) =     0.98 Prob >= chibar2 =
0.161

.

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```