Hello, I have a dataset that has multiple measurements of air pollution over time that were originally arranged in wide format Ex. pollution_month1 pollution_month2 pollution_month3 etc. In addition I have a huge number of other variables (potentially confounding or explanatory exposures, additional outcomes) including age, bmi, etc. I used Proc transpose to create a long format version of the pollution variables with a copy statement to maintain the presence of the other covariates for use in a GEE or GLMM, but I noticed that the datasets only copied the information for the non-pollution data on a single line for each subject. Here's an example with subject ID, age, and the repeated measures for pollution: data WORK.IPNEW2; infile datalines dsd truncover; input id:11. age:32. NO2:32.; format id 11.; label id="IDCode" age="Mother's age at baseline"; datalines; ID Age Pollution 10001 32 47.813976991 10001 . 60.016236077 10001 . 53.004974541 10001 . 48.732284383 10002 36 55.695500415 10002 . 43.528170487 Any time I have used either proc genmod or proc glimmix with repeated measures before, the data has been structured such that entire entry has been copied except for whichever variable is being repeated. I suppose two questions here: 1: is it necessary for the data to be completely filled? I'm assuming it is, because when I ran a logistic regression on this, it had a ton of missing entries, which seems completely wrong. 2: Is there any way that I can take the values that have been copied over to the first entry and apply them (except for the repeated measures of course) to the every entry in my new dataset? in the above example, I would like to apply the age 32 to every listing of subject 10001 and 36 to every listing of 10002 as follows: ID Age Pollution 10001 32 47.813976991 10001 32 60.016236077 10001 32 53.004974541 10001 32 48.732284383 10002 36 55.695500415 10002 36 43.528170487 I'd really appreciate any help available, please let me know if there is any additional information necessary that I can provide. If it's any help, here is a makeshift version of the code that I used to transpose the variables I used for pollution: proc transpose data=wide out=long prefix=n;
by ID;
var N1-N4;
copy
age;
run; Thanks for any help! Dan
... View more