Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down at the end of May, and its replacement, **statalist.org** is already up and running.

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

From |
Sheela Athreya <athreya@tamu.edu> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: vce matrix manipulation before and after pca |

Date |
Thu, 5 Aug 2010 20:33:52 -0500 |

I am trying to do the following in StataSE 11.1 for the Mac (OS 10.6) using a dataset comprised of 23 continuous variables (measurements of the skeleton) on 11,000 modern humans--a mixed sample of adult males and females. 1) Do a PCA of the males and females separately (I used the operation: "by SEX_CODED, sort : pca GOL-OAA") 2) Average the resulting vce matrices together My question is: how do I save the two vce matrices that are computed from these two pca's (one on each sex) and average them together to form one pooled-sex vce matrix? I don't know Mata so my question is related to doing this in Stata SE 11.1. -I tried this using the command "matrix define ModPooledSex = __000001+__000000/2"--in other words, the two resulting matrices that were in memory, I added together and tried to divide by 2. I got the error "000000 not found", even though that was one of the matrix names available in the pull-down menu under "define matrix from expression"--presumably it was one of two matrices automatically stored in memory. When I tried to do the same thing again, I only saw one matrix (named 000000) in memory. I am able to view that matrix, but not save or manipulate it at all. I have tried "estimates store", but can't retrieve the actual vce matrix to manipulate it or use it in other analyses. My next question is: how can I then use a user-defined vce matrix (the pooled-sex one) and take another dataset entirely (of the same measurements, but different individuals, called Dataset2) and compute PC scores for Dataset2 based on the pooled-sex vce matrix from the modern human dataset? I hope this isn't too confusing, or too basic. I've been rooting around in all the documentation, the statalist archives, etc for hours before posting to the list, but I truly just can't figure it out. Any help would be greatly appreciated. Many thanks, ******************************* Sheela Athreya, Ph.D. Department of Anthropology Texas A&M University College Station, TX 77843 * * 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/

**Follow-Ups**:**st: AW: vce matrix manipulation before and after pca***From:*"Martin Weiss" <martin.weiss1@gmx.de>

- Prev by Date:
**st: marginal effects after quantile regression** - Next by Date:
**st: Applying survey weight after mi** - Previous by thread:
**st: marginal effects after quantile regression** - Next by thread:
**st: AW: vce matrix manipulation before and after pca** - Index(es):