Announcement

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

  • ssd sem results differ from raw data sem results stata

    Using two different datasets, I cannot get stata to give me comparable efa/sem results when using summary statistics vs. raw data. I am not sure what I am missing...
    The raw data is from:
    use http://www.stata-press.com/data/r15/sem_1fmm

    The summary data and basic efa syntax are as follows:

    clear
    ssd init x1 x2 x3 x4
    ssd set obs 500
    ssd set correlations 1.0 \ .4537 1.0 \ .4491 .5091 1.0 \ .6525 .6801 .6975 1.0
    ssd set means 99.518 99.954 99.052 94.474
    ssd set sd 14.35402 14.1939 14.26395 70.11603

    [OR]

    clear
    ssd init x1 x2 x3 x4
    ssd set obs 500
    ssd set means 99.518 99.954 99.052 94.474
    ssd set sd 14.35402 14.1939 14.26395 70.11603
    #delimit;
    ssd set correlations
    1.0 \
    .4537 1.0 \
    .4491 .5091 1.0 \
    .6525 .6801 .6975 1.0 ;
    #delimit cr

    ssd status
    ssd list

    save "C:\Users\...\Desktop\_EFA.dta"

    cd "C:\Users\...\Desktop"
    use _EFA

    factor x1-x4, ml factors(1)

    *Question: what about using ssd or my code leads stata (v. 15.1) to produce not even remotely close results?

  • #2
    You can certainly feed the factor command a correlation matrix. If you ran factor after inputting summary statistics data, though, I'm pretty sure it treats the data as if were real data. Here is a listing of the actual data after you input the SSD characteristics:

    Code:
         +-----------------------------------------------------------+
         | _group   _type         x1        x2         x3         x4 |
         |-----------------------------------------------------------|
      1. |      1       1     99.518    99.954     99.052     94.474 |
      2. |      1       2   14.35402   14.1939   14.26395   70.11603 |
      3. |      1       3          1     .4537      .4491      .6525 |
      4. |      1       4      .4537         1      .5091      .6801 |
      5. |      1       5      .4491     .5091          1      .6975 |
         |-----------------------------------------------------------|
      6. |      1       6      .6525     .6801      .6975          1 |
         +-----------------------------------------------------------+
    So, that's what the factor command is running an EFA on, and indeed, you see that you had 6 observations in your factor output. You want to input your correlations as a matrix, and use factormat instead.
    Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

    When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

    Comment


    • #3
      Thank you Weiwan. This indeed worked. I noticed that the sample size, using the previous matrix input method, was off...

      Comment

      Working...
      X