That solved the problem nicely. What a fantastic way to solve this problem; my data step (4 pages of code...) would not have impressed You. Thanks again.
... View more
Hello everyone! I've been struggling for a few days to solve the this task. The setting/study - Observational data. Patients with Crohns Disease. Data was collected annually during 2002–2013 in a large region in Sweden. - Patients can be included any year and visits may be irregular on a annual basis (some patients might visit the clinic every year, other come only one time during the study period). - I know the exact day of death for each patient. VARIABLE: DEATH_YEAR - I know the exact day of relapse (one of the endpoints of interest). VARIABLE: RELAPSE_YEAR I am interested in the incidence of relapse and I need to calculate the number of relapses each year divided by the number of individuals alive that year. Now the problem is that from inclusion, individuals come irregularly, but I do know if they are actually alive that year and if they have experienced a relapse. I could solve this (if I only could...) if I could create 12 new variables for each patient. Each new variable should be the calendar year and this variable should be set to '1' if the patient is alive that year. Thus the problem is that i need to create a 'year-variables' that are set to '1' for each year at inclusion and thereafter, given that the person is not dead, or has experienced the event. An example: Patient X was included 2005 and died 2009. For him I would need he following variables: '2005', '2006', '2007', '2008' and '2009' set to '1'. Patient Y was included 2005 and experienced event 2007. For him I would need the following variables: '2005', '2006', 2007' set to '1'. (Yes, year of event/death need still be set to '1'). I would be extremely grateful for any advice on this! Thanks in advance! /adam
... View more
Hi again It is still unclear to me why the statical recommended the fore mentioned data layout for individuals with events. It is now clear to me, after the above explanations and further discussions with other staticians that: individuals with events need no observations after the event time if the event is permanent (in this case, once heart failure, always heart failure). I appreciate your answers above! Thank you
... View more
Thank You Muhlbaier, I've carefully read your reply and I agree with it. However, it might be that the PROC PHREG handles the procedure this way. Moreover, I have not found a single SUGI paper commenting on this, neither in Paul Allisons book. Searched google extensively aswell. I will try your solution though, and get back to you with the results. Thanks.
... View more
Hi I'm modeling time to event data with Cox regression (PROC PHREG). I have used PROC PHREG before without running into trouble. Event of interest: heart failure. Baseline variables: age, sex. Time-dependent variables: cholesterol, blood pressure, blood glucose. Each individual has several observations with start and stop time for each of these (see table below).. I have checked my data set, it is most likely correctly configured and looks like the table below. Showing an individual who experienced an event between his 3rd and 4th observation. Subject start_time stop_time cholesterol event 1 0 2 2 0 1 2 6 2 0 1 6 7 4 0 1 7 10 5 0 1 10 13 3 0 1 13 16 3 1 Now, you might notice the event indicator shows that the individual had an event on his last observation, despite the event occuring between the 3rd and 4th observation. This was instructed to me by an experienced statician; she told me that, in a time-dependent cox regression with counting process syntax, individuals who experience the event should have that indicated on their last observation; regardless of when the event occured. This is somewhat non intuitive and i wonder whether this is correct. Particularly since my results show that higher cholesterol, higher blood pressure and increasing age decreases the hazard ratio; this is certainly wrong. Is it something I am forgetting? I would appreciate some advice on this.
... View more
I implemented all suggestions Steve; it worked great and the work is done. Using only one random statement reduced computing times markedly. sp(pow) brought parameter estimates closer to what descriptive data indicate. Thanks.
... View more
Hi I sincerely appreciate the detailed and educating reply Steve. Thank you. I took your advice; I grand mean centered continuous predictors (incl followup), however I did not center the outcome (assuming interpretations would be more straight forward). Since I applied all your advice at once, I could not conclude which one of these resulted in: 1) Running the models now take 5-10 minutes (500'000 observations tested) which is several times faster. 2) 'Followup' and 'Followup*Followup' are significant as fixed effects (solutions), however the type 3 test results in a non significant 'followup'. 3) There were several interactions. I did not fit Your last model since repeated measuresments are spaced (in time) very unequally for individuals in the study. I will run the models tomorrow and post some results here, in case that would be interesting. Thanks again! & Happy new years!
... View more
Among many tutorials on this topic, I think you would find this one helpfull: http://support.sas.com/resources/papers/proceedings13/433-2013.pdf It describes multilevel models in proc mixed with 4 examples, both organizational and growth models.
... View more
I have done the same analysis, in the way Steve Denham explains and it worked out well. This topic is described here aswell: 24188 - Modeling a rate and estimating rates and rate ratios (with confidence intervals)
... View more
Hi everyone I'm trying to model a continuous outcome variable (blood pressure) against categorical and continuous predictors. The study is longitudinal, includes several observations for each individual and follow up is between 5 and 10 years. I am interested in examining how treatment group impacts blood pressure. For all treatment groups the value of the outcome (blood pressure) decrease the first 3-4 years and then increases steadily the remaning years in the study. Initially i used PROC MIXED with random effects for person (repeated measurements), treatment group (individuals where nested within treatment groups) and follow up time. Here is the code: proc mixed data = DATASET covtest noclprint method=reml; class Person_ID Treatment_Group; model bloodpressure = followup followup*followup Treatment_Group / solution ddfm = satterthwaite; random intercept / sub=Person_ID type=ar(1); random intercept / sub=Person_ID (Treatment_Group) type=ar(1); run; Thus, in order to manage the nonlinear outcome i squared the time variable (followup). This rendered parameter estimates more credible. So, the non-linear outcome could be accounted for in PROC MIXED by this method. Should i prefer doing this in PROC NLMIXED? Note that SAS performed my analysis, which included almost a million observations, in 20 minutes; extremely fast compared to other software.mixed
... View more
Thanks for Your time Astounding, data _null and Tal, however the problem was not solved. It would be great if this problem could be solved. I'm sure there are many SAS users out there dealing with this problem. My solution right now is executing one proc tabulate per categorical variable. However this is very time consuming since tables must be unioned later in a text editor. Perhaps there isn't a fix for this, other than going around an output via proc freq/summary. :smileyplain:
... View more