Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: reproducing published CFA results using -ssd- / -sem-


From   Stas Kolenikov <skolenik@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: reproducing published CFA results using -ssd- / -sem-
Date   Tue, 12 Mar 2013 09:38:04 -0500

I am working to reproduce some published multiple traits - multiple
methods results, and Stata does not want to cooperate. The code below
produces "initial values not feasible" error, even though I think I
have paranoidally set most of the initial values explicitly, and
constrained covariances between the "traits" and the "methods" to be
zero. How can I get a better idea of how Stata sets initial values?
(Do not comment on the lousy precision of two-digit correlations and
model complexity; this is not my data, my model or my paper.)

The code is long, but it runs.

clear

* Reproducing CFA of Lorenz Melby Conger and Xu.sas;
* Journal of Family Psychology;
* The effects of context on the correspondence between observational
ratings and questionnaire reports
*    of hostile behavior: A multitrait, Multimethod Approach;

#delimit ;

ssd init hostility_or angrycoercionor antisocialbehavior_or
	criticize_selfnow angry_selfnow argue_selfnow shout_selfnow
	criticize_selfpast angry_selfpast argue_selfpast shout_selfpast
	criticize_partnernow angry_partnernow argue_partnernow shout_partnernow
	criticize_partnerpast angry_partnerpast argue_partnerpast shout_partnerpast;

ssd set obs 292;	

ssd set means
	4.13  2.14  5.33  2.27  1.70  1.87  1.21  1.26  1.61  1.86  1.18
2.41  1.76  2.11  1.30  1.42  1.64  1.95  1.22
;

ssd set sd
	2.36  1.70  1.87  1.37  1.05  1.23  0.52  0.98  0.96  1.38  1.06
1.43  1.07  1.27  0.68  1.17  1.07  1.36  1.23
;

ssd set correlations
	1 \
	.73   1 \
	.79   .58   1 \
	.37   .28   .38   1 \
	.39   .34   .42   .57  1 \
	.39   .29   .42   .61   .78   1 \
	.19   .24   .30   .39   .59   .58   1 \
	.11   .02   .11   .35   .25   .35   .21   1 \
	.26   .20   .21   .34   .31   .35   .21   .53   1 \
	.30   .21   .23   .32   .30   .35   .12   .52   .65   1 \
	.26   .19   .20   .35   .36   .34   .32   .60   .70   .64   1 \
	.48   .31   .39   .37   .35   .37   .15   .16   .24   .20   .18   1 \
	.44   .35   .38   .35   .49   .46   .25   .25   .29   .24   .30   .62   1 \
	.50   .42   .47   .40   .51   .53   .30   .24   .32   .28   .32   .62
  .74   1 \
	.26   .28   .24   .25   .30   .26   .27   .16   .19   .18   .19   .26
  .44   .44   1 \
	.31   .21   .28   .34   .29   .34   .24   .33   .42   .34   .42   .46
  .45   .44   .22   1 \
	.34   .24   .25   .34   .31   .28   .20   .22   .44   .31   .46   .38
  .43   .39   .19   .65   1 \
	.28   .17   .24   .32   .27   .31   .17   .20   .45   .32   .43   .34
  .38   .44   .23   .54   .63   1 \
	.32   .17   .28   .33   .30   .29   .20   .26   .46   .33   .50   .44
  .46   .42   .25   .68   .77   .64   1
;

ssd status;

foreach trait in OR_Factor SelfNow_Factor SelfPast_Factor
PartnerNow_Factor PartnerPast_Factor {;
	foreach method in Criticize_Factor Angry_Factor Argue_Factor Shout_Factor {;
		local constrcov `constrcov' `trait'*`method'@0;
	};
};

foreach factor in OR_Factor SelfNow_Factor SelfPast_Factor
PartnerNow_Factor PartnerPast_Factor
	Criticize_Factor Angry_Factor Argue_Factor Shout_Factor {;
		local varopt `varopt' (`factor', init(1) );
};

sem
	(OR_Factor   -> (hostility_or, init(1))
	                (angrycoercionor , init(1))
					(antisocialbehavior_or , init(1))
					)
	(SelfNow_Factor   -> (criticize_selfnow , init(1) )
	                     (angry_selfnow , init(1) )
						 (argue_selfnow , init(1) )
						 (shout_selfnow , init(1) )
						 )
	(SelfPast_Factor  -> (criticize_selfpast , init(1) )
	                     (angry_selfpast , init(1) )
						 (argue_selfpast , init(1) )
						 (shout_selfpast , init(1) )
						 )
	(PartnerNow_Factor  -> (criticize_partnernow , init(1) )
	                       (angry_partnernow , init(1) )
						   (argue_partnernow , init(1) )
						   (shout_partnernow , init(1) )
						   )
	(PartnerPast_Factor  -> (criticize_partnerpast , init(1) )
	                        (angry_partnerpast , init(1) )
							(argue_partnerpast , init(1) )
							(shout_partnerpast , init(1) )
							)
	(Criticize_Factor -> (criticize_selfnow , init(1) )
	                     (criticize_selfpast , init(1) )
						 (criticize_partnernow , init(1) )
						 (criticize_partnerpast , init(1) )
						 )
	(Angry_Factor -> (angry_selfnow , init(1) )
	                 (angry_selfpast , init(1) )
					 (angry_partnernow , init(1) )
					 (angry_partnerpast , init(1) )
					 )
	(Argue_Factor -> (argue_selfnow , init(1) )
	                 (argue_selfpast , init(1) )
					 (argue_partnernow , init(1) )
					 (argue_partnerpast , init(1) )
					 )
	(Shout_Factor -> (shout_selfnow , init(1) )
	                 (shout_selfpast , init(1) )
					 (shout_partnernow , init(1) )
					 (shout_partnerpast , init(1) )
					 )
	, cov( `constrcov' ) var( `varopt' ) ;
	
exit;


-- Stas Kolenikov, PhD, PStat (SSC)
-- Senior Survey Statistician, Abt SRBI
-- Opinions stated in this email are mine only, and do not reflect the
position of my employer
-- http://stas.kolenikov.name
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index