Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
"Martin Weiss" <martin.weiss1@gmx.de> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: RE: graphing the lines of the mean for a varaible by groups over time |

Date |
Fri, 12 Mar 2010 19:55:48 +0100 |

<> ************* help grmeanby ************* may also be of interest... HTH Martin -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Mandy fu Sent: Freitag, 12. März 2010 19:06 To: statalist@hsphsun2.harvard.edu Subject: st:graphing the lines of the mean for a varaible by groups over time Hello everyone, I have a question of graphing the lines of a variable by groups over time on a three-period panel data set. I have an unbalanced 3-period panel data set, where the observations are divided into four racial groups. I would like to plot the predicted value of Y (which is variable Y_hat, results from previous regression of Y on X variables) by racial groups over the three periods. The X-axis measures time, 1,2,3; The Y-axis measures Y-hat. In the graph there are four lines, repenting the four racial groups, which measure the mean Y_hat for a particular group at each time. The data set is as following: ------------------------------------------------------------ ID Y_hat time race Y X1 X2 1 1.22 1 1 1 2.03 2 1 1 3.00 3 1 2 1.45 1 2 2 2.67 2 2 2 missing 3 2 ------------------------------------------------------------ I tried the following syntax: ------------ line Y_hat time if race==1 ,c(L) /// || line Y_hat time if race==2 ,c(L) /// || line Y_hat time if race==3 ,c(L) /// || line Y_hat time if race==1 ,c(L) /// || , title("plotting") --------------- The graph from the above syntax includes lots of lines, which is not what I would like to see. I think I must misunderstood something here. I would appreciate if you could give me some suggestions. Thanks for your time! Mandy * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**References**:**st:graphing the lines of the mean for a varaible by groups over time***From:*Mandy fu <mandy.fu1@gmail.com>

- Prev by Date:
**st: RE: Urgent request** - Next by Date:
**st: Concordance** - Previous by thread:
**st: RE: graphing the lines of the mean for a varaible by groups over time** - Next by thread:
**st: Urgent request** - Index(es):