Announcement

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

  • How to diplay the partial correlation and significance value from the pcorr loop?

    This is my code, it keeps show missing value in the loop, but when I run the poor along the data is correct, thanks for the help!

    . local frailty "grip_f"

    . local structure "brainsegvolnotvent ventricle"

    .
    . foreach i in `frailty'{
    2. foreach k in `structure'{
    3. quietly pcorr `k' `i' c.age i.gender c.edu_yr c.ICV
    4. matrix N=r(p_corr)
    5. local ra= N[1,2]
    6. local pa= N[1,3]
    7. display "`k'" _column(35)round(`ra',0.0001) _column(45)round(`pa',0.0001)
    8. }
    9. }
    brainsegvolnotvent . .
    ventricle . .


    . pcorr brainsegvolnotvent grip_f c.age i.gender c.edu_yr c.ICV
    (obs=279)

    Partial and semipartial correlations of brainsegvolnotvent with

    Partial Semipartial Partial Semipartial Significance
    Variable | corr. corr. corr.^2 corr.^2 value
    ------------+-----------------------------------------------------------------
    grip_f | 0.0040 0.0019 0.0000 0.0000 0.9470
    age | -0.4386 -0.2260 0.1924 0.0511 0.0000
    0b.gender | (dropped)
    1.gender | 0.0303 0.0141 0.0009 0.0002 0.6164
    edu_yr | 0.2177 0.1033 0.0474 0.0107 0.0003
    ICV | 0.8112 0.6423 0.6581 0.4126 0.0000

  • #2
    You seem to be entering these commands interactively in the command window. This may be leading to situations where the relevant macros are not in memory when the loop is being executed. Instead, enter the commands in a do-file and run them together.

    Comment

    Working...
    X