Hi,
I am trying to fit two fitted lines on the same scatter plot after running an ANCOVA and two lincom commands after the ANCOVA. I would like to fit the two fitted lines from the lincom commands on the same scatter plot. I have two treatment groups, phone vs. newsletter, represented by the variable assignment_r.
Below is a small sample of the data and the main variables:
Here is what I do in terms of the ANCOVA and lincom commands:
Then, I would like to put the two fitted regression lines from the two lincom commands (the first lincom command represents the newsletter group line and the second lincom command represents the phone group line) onto the same scatter plot with sppb_ch_12mo on the x-axis and PCS_ch_12mo on the y-axis. Would really appreciate any help with this.
Thank you.
I am trying to fit two fitted lines on the same scatter plot after running an ANCOVA and two lincom commands after the ANCOVA. I would like to fit the two fitted lines from the lincom commands on the same scatter plot. I have two treatment groups, phone vs. newsletter, represented by the variable assignment_r.
Below is a small sample of the data and the main variables:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long pid float(sppb_ch_12mo PCS_ch_12mo) long assignment_r 10002 1 6.880001 1 10005 3 8.209999 0 10008 -1 0 1 10011 -2 -5.68 1 10012 0 -6.330002 1 10013 -2 7.989998 0 10015 -2 -3.009998 1 10017 2 11.07 1 10024 -1 8.670002 1 10025 1 4.830002 0 end label values assignment_r assignment_r label def assignment_r 0 "Newsletter", modify label def assignment_r 1 "Phone", modify
Code:
regress PCS_ch_12mo sppb_ch_12mo i.assignment_r lincom _cons+1*sppb_ch_12mo lincom _cons+1*sppb_ch_12mo+1.assignment_r
Thank you.
Comment