Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Forming an index based on the corvariance matrics of variables.

    Dear all,

    May I ask your favor for showing how can I derive what I want:

    As the table shows, for each subject, I have collected 5 variables (Q1-Q5) measuring their mental health condition in different aspects. Right now, I want to form an index to represent subjects' mental health levels for further analysis. Among the literature, I have found a method to achieve this. However, since I have no experience with matrix operation at all, I lost myself for the next step.
    Click image for larger version

Name:	Screenshot 2021-04-12 at 15.43.30.png
Views:	1
Size:	35.4 KB
ID:	1603058


    It will be appreciated if anyone can tell me how to generate this index variable in Stata. Thank you for your help in advance. (You can use the example table for demonstration)
    subject Q1 Q2 Q3 Q4 Q5
    1 3 3 1 2 4
    2 3 2 2 5 5
    3 4 4 2 4 6
    4 7 6 6 7 8
    5 8 7 3 7 4
    6 4 8 6 5 6
    7 1 2 3 2 1
    8 3 3 2 2 3
    9 5 4 1 7 6
    10 5 6 7 8 7
    Best regards,
    Wu
    Last edited by Jilong Wu; 12 Apr 2021, 08:28.

  • #2
    Subsequently reposted in the General Forum, a more appropriate location for questions about constructing Stata variables. This forum (the Mata Forum) is is used for discussions of Stata's Mata language, which is different than Stata's command language.

    https://www.statalist.org/forums/for...s-of-variables

    Comment

    Working...
    X