Handout19 - Lecture 19 1. Plotting longitudinal data 2....

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Lecture 19 1. Plotting longitudinal data 2. Longitudinal data: long form and wide form 3. Reshaping data from wide to long 4. Reshaping data from long to wide 5. Proc Transpose 1 Longitudinal data When people or experimental units are measured more than once over time, we have longitudinal data , also called repeated measures or time series data. Family economics data: total family income, expenditures, debt status for 50 families in two groups ( A and B ), annual records from 1990–1995. Records for family 1. One observation for each year. family_ Obs id income year expenses debt group 1 1 66483 1990 49804 no A 2 1 69146 1991 65634 no A 3 1 74643 1992 61820 no A 4 1 79783 1993 68387 no A 5 1 81710 1994 85504 yes A 6 1 86143 1995 75640 no A 2 Plotting longitudinal data Want to plot the income against year for each family: x = year y = income need year and income as variables. Family 1. 3 family_ Obs id income year expenses debt group 1 1 66483 1990 49804 no A 2 1 69146 1991 65634 no A 3 1 74643 1992 61820 no A 4 1 79783 1993 68387 no A 5 1 81710 1994 85504 yes A 6 1 86143 1995 75640 no A 7 2 17510 1990 21609 yes B 8 2 19484 1992 18180 no B 9 2 20979 1993 22985 yes B 10 2 21268 1994 11097 no B 11 2 22998 1995 21768 no B Proc SGplot data=a; series x=year y=income / group =family_id LineAttrs= (pattern=1 color="black"); series – draws a line connecting sequential observations LineAttrs – draw solid, black lines 4 Often called “spaghetti plot.” 5 Without specifying color="black" : 6 Without specifying (pattern=1 color="black") : 7 Families are in 2 groups, A or B . To get separate plots for each group, we must group by family id within each group. SGplot allows only one grouping variable. Proc SGpanel data=a; produces multiple plots on one page PanelBy group / columns=2; series x=year y=income / group =family_id LineAttrs= (pattern=1 color="black"); Note: SGplot and SGpanel do not need ODS graphics on/off commands....
View Full Document

This note was uploaded on 11/21/2011 for the course PUBH 6470 taught by Professor Williamthomas during the Fall '11 term at University of Florida.

Page1 / 12

Handout19 - Lecture 19 1. Plotting longitudinal data 2....

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online