L3handout - PUBH 7430 Lecture 3 J. Wolfson Division of...

Info iconThis preview shows pages 1–10. 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

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

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: PUBH 7430 Lecture 3 J. Wolfson Division of Biostatistics University of Minnesota School of Public Health September 13, 2010 Beta-carotene dataset discussion Note: Code accompanying this lecture will be available on the course website: http://www.biostat.umn.edu/ ~ julianw/courses/pubh7430/ Example: Beta-carotene study Phase II study of pharmacokinetics of beta-carotene supplementation 46 subjects randomly assigned to one of five doses of beta-c: 0, 15, 30, 45, or 60 mg/day Serum beta-carotene levels measured at baseline, 3 months, 9 months Primary aim: Determine how different beta-c doses affect serum beta-c and vitamin E levels Baseline covariates include age, sex, weight, BMI, percent body fat, cholesterol Reshaping data Longitudinal data come in two shapes: Wide: Each line of data corresponds to one subject ; repeated measurements appear in separate variables subjID carot0 carot1 carot3 1 XXX XXX XXX 2 YYY YYY YYY . . . . . . . . . . . . N ZZZ ZZZ ZZZ Reshaping data, contd. Long: Each line of data corresponds to one observation ; each subjects data spans multiple lines subjID time carot 1 XXX 1 1 YYY 1 3 ZZZ . . . . . . . . . N xxx N 1 yyy N 3 zzz Reshaping data: R code Moving between shapes is generally straightforward in standard software packages (illustrated for carotene measurements only): R Wide to long: reshape(carot,varying=list( c("carot0","carot1","carot3") ), id=subjID, direction="long") Long to wide: reshape(carot,v.names=c("carot0"), timevar="time", id=subjID, direction="wide") Reshaping data: SAS code SAS Wide to long: proc transpose data=carotwide out=carotlong; by subjID; run; Long to wide: proc transpose data=carotlong out=carotwide prefix=carot; by subjID; id time; var carot; run; Descriptive plots Basic plot of beta-carotene values at each time point:...
View Full Document

Page1 / 24

L3handout - PUBH 7430 Lecture 3 J. Wolfson Division of...

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

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