Announcement

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

  • forest plot with linear regression by groups

    Hello everyone,

    I have a dataset with two variables treated as both categorical and continuous. I'm attempting to create scatterplots that depict the relationship between the two continuous variables within each subgroup of the categorized variable. However, my current results are not satisfactory, as I'm obtaining the same p-value in all four scatterplots. I would appreciate any assistance with this issue. Thank you.

    CODE:

    reg ntprobnp any_sv
    local r2: display %3.2f e(r2)
    twoway (scatter ntprobnp any_sv) (lfitci ntprobnp any_sv), note(R-squared=`r2') by(BNPcut SV)
    Click image for larger version

Name:	Screenshot 2024-01-30 at 20.53.58.png
Views:	1
Size:	319.8 KB
ID:	1741601

Working...
X