Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

 From "Grant, Robert" To "statalist@hsphsun2.harvard.edu" Subject st: Bootstrapping factor loadings Date Tue, 28 Feb 2012 10:15:40 +0000

```Following an earlier thread (http://www.stata.com/statalist/archive/2012-02/msg00036.html), a fellow Statalister asked me off-list about extending this to more than one factor. This is pretty easy to do once you have got the idea of the requirements of -bstat- but I include my suggested code here in case it is of use to anyone in the future:

If you have more than one factor, the e(r_L) matrix will have more than one column, one for each factor. If you are using -pca- instead, the same loadings matrix will be called e(b). You need to rearrange them into a single-column vector which here I call obs, and that contains point estimates which -bstat- will then access. If you are not interested in inference for extra stuff such as the % variance explained, then it is simple:

// example begins -------------------------------------------
// first, get the observed point estimates:
factor var1 var2 var3 ... var26, pcf factors(4) // here there are 4 factors and 26 variables
rotate, promax // I hope this makes sense - I "don't do" oblique rotations
forvalues i=1/4 {
}

// then carry on with the program...
// example ends --------------------------------------------

Or if you need extra stuff, have a loop for columns within each loop for rows:

// example begins -------------------------------------------
// first, get the observed point estimates:
factor var1 var2 var3 ... var26, pcf factors(4) // here there are 4 factors and 26 variables
rotate, promax // I hope this makes sense - I "don't do" oblique rotations
forvalues i=1/26 {
forvalues j=1/4 {
}
}
// I was interested in % variance explained - you might want to add other stats in.
scalar varexpl=e(rho)
// now put it back together:
.
.
.
.
varexpl)
/* then carry on with the program...
but be very careful to cite the individual loadings and stats within -simulate- in exactly the same order as above; here I have gone across rows then down columns which looks nicer as j<i but is slightly unconventional in loadings I suppose */

// and here comes the program...
capture: program drop myboot
program define myboot, rclass
preserve
bsample
factor var1 var2 var3 ... var26, pcf factors(1)
rotate, promax
forvalues i=1/26 {
}
scalar bootexp=e(rho)
restore
end

// now you use -simulate- to run the -myboot- program, creating one resample each time.
myboot
bstat, stat(obs) n(999) // put the original number of observations into n()
estat bootstrap, all

// example ends --------------------------------------------

Robert Grant
Senior Research Fellow in Quantitative Methods
Faculty of Health & Social Care Sciences,
St. George's, University of London & Kingston University,
Grosvenor Wing, Cranmer Terrace, London, SW17 0RE.

Telephone +44 (0)20 8725 2281
Website http://staffnet.kingston.ac.uk/~ku45386

This email has been scanned for all viruses by the MessageLabs Email
Security System.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```