Announcement

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

  • format option not working in Stata's rotate command?

    Hello!

    Does anyone know why the following code doesn't seem to be causing the returned results to be reported to 2 decimal places (it's returning the usual 4 decimal places)?

    Code:
    factor iees_01 iees_03 iees_04 iees_05 iees_06 iees_07 iees_08 iees_09 iees_10 iees_11 iees_12 iees_13 iees_15 iees_17 iees_18 iees_20 if val_ind == 0, ipf citerate(1000) factors(4)
    rotate, promax(3) oblique blank(0.32) format(%9.2f)
    The documentation for rotate says that format() should be an available option (if I'm reading it correctly).

    I'm running Stata 17.0 if that's important.

    Thank you!
    Last edited by Evan Sommer; 03 Apr 2026, 18:54.

  • #2
    I think you're right. Here is a reproducible example used in Stata 19.

    Code:
    . webuse bg2
    (Physician-cost data)
    
    . factor bg2cost1-bg2cost6, factors(2)
    (obs=568)
    
    Factor analysis/correlation                      Number of obs    =        568
        Method: principal factors                    Retained factors =          2
        Rotation: (unrotated)                        Number of params =         11
    
        --------------------------------------------------------------------------
             Factor  |   Eigenvalue   Difference        Proportion   Cumulative
        -------------+------------------------------------------------------------
            Factor1  |      0.85389      0.31282            1.0310       1.0310
            Factor2  |      0.54107      0.51786            0.6533       1.6844
            Factor3  |      0.02321      0.17288            0.0280       1.7124
            Factor4  |     -0.14967      0.03951           -0.1807       1.5317
            Factor5  |     -0.18918      0.06197           -0.2284       1.3033
            Factor6  |     -0.25115            .           -0.3033       1.0000
        --------------------------------------------------------------------------
        LR test: independent vs. saturated:  chi2(15) =  269.07 Prob>chi2 = 0.0000
    
    Factor loadings (pattern matrix) and unique variances
    
        -------------------------------------------------
            Variable |  Factor1   Factor2 |   Uniqueness 
        -------------+--------------------+--------------
            bg2cost1 |   0.2470    0.3670 |      0.8043  
            bg2cost2 |  -0.3374    0.3321 |      0.7759  
            bg2cost3 |  -0.3764    0.3756 |      0.7173  
            bg2cost4 |  -0.3221    0.1942 |      0.8586  
            bg2cost5 |   0.4550    0.2479 |      0.7315  
            bg2cost6 |   0.4760    0.2364 |      0.7176  
        -------------------------------------------------
    
    . rotate
    
    Factor analysis/correlation                      Number of obs    =        568
        Method: principal factors                    Retained factors =          2
        Rotation: orthogonal varimax (Kaiser off)    Number of params =         11
    
        --------------------------------------------------------------------------
             Factor  |     Variance   Difference        Proportion   Cumulative
        -------------+------------------------------------------------------------
            Factor1  |      0.72783      0.06070            0.8788       0.8788
            Factor2  |      0.66713            .            0.8055       1.6844
        --------------------------------------------------------------------------
        LR test: independent vs. saturated:  chi2(15) =  269.07 Prob>chi2 = 0.0000
    
    Rotated factor loadings (pattern matrix) and unique variances
    
        -------------------------------------------------
            Variable |  Factor1   Factor2 |   Uniqueness 
        -------------+--------------------+--------------
            bg2cost1 |   0.4239    0.1268 |      0.8043  
            bg2cost2 |  -0.0499    0.4708 |      0.7759  
            bg2cost3 |  -0.0524    0.5291 |      0.7173  
            bg2cost4 |  -0.1256    0.3545 |      0.8586  
            bg2cost5 |   0.5089   -0.0973 |      0.7315  
            bg2cost6 |   0.5178   -0.1195 |      0.7176  
        -------------------------------------------------
    
    Factor rotation matrix
    
        --------------------------------
                     | Factor1  Factor2 
        -------------+------------------
             Factor1 |  0.7727  -0.6348 
             Factor2 |  0.6348   0.7727 
        --------------------------------
    
    . rotate, format(%9.2f)
    
    Factor analysis/correlation                      Number of obs    =        568
        Method: principal factors                    Retained factors =          2
        Rotation: orthogonal varimax (Kaiser off)    Number of params =         11
    
        --------------------------------------------------------------------------
             Factor  |     Variance   Difference        Proportion   Cumulative
        -------------+------------------------------------------------------------
            Factor1  |      0.72783      0.06070            0.8788       0.8788
            Factor2  |      0.66713            .            0.8055       1.6844
        --------------------------------------------------------------------------
        LR test: independent vs. saturated:  chi2(15) =  269.07 Prob>chi2 = 0.0000
    
    Rotated factor loadings (pattern matrix) and unique variances
    
        -------------------------------------------------
            Variable |  Factor1   Factor2 |   Uniqueness 
        -------------+--------------------+--------------
            bg2cost1 |   0.4239    0.1268 |      0.8043  
            bg2cost2 |  -0.0499    0.4708 |      0.7759  
            bg2cost3 |  -0.0524    0.5291 |      0.7173  
            bg2cost4 |  -0.1256    0.3545 |      0.8586  
            bg2cost5 |   0.5089   -0.0973 |      0.7315  
            bg2cost6 |   0.5178   -0.1195 |      0.7176  
        -------------------------------------------------
    
    Factor rotation matrix
    
        --------------------------------
                     | Factor1  Factor2 
        -------------+------------------
             Factor1 |  0.7727  -0.6348 
             Factor2 |  0.6348   0.7727 
        --------------------------------
    The underlying code appears to be inbuilt, and so not accessible to users.

    If StataCorp personnel don't respond -- modulo what is probably a holiday weekend -- send a signal to StataCorp technical services.

    Comment


    • #3
      Thanks for your response, Nick. Just letting folks know that I reached out to "[email protected]" <[email protected]> about this issue. I'll report back based on what I hear from them.

      Comment


      • #4
        Just following up with the response from Stata Technical Services. It's not really a bug, but the PDF manual entry could certainly be more clear. Sounds like they may edit it for clarity.

        The format() option applies to the matrix output shown when detail is specified. In this case, that refers to the rotatemat output, such as the rotated factors and orthogonal rotation values displayed by

        Code:
         
         rotate, detail format(%9.2f)
        The standard output from `rotate` is actually the replay output from `factor`, and its numeric display is not affected by the `format()` option.

        So the current behavior is:

        Code:
         
         rotate, detail format(%9.2f)
        affects the displayed matrix output

        Code:
         
         rotate, format(%9.2f)
        does not change the standard replay output


        It may be that the documentation could be clearer here, since the “matrices” referenced in the `format()` description are the `rotatemat` output shown with `detail`.

        Thank you for bringing this to our attention.

        Comment

        Working...
        X