LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 2008, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 5 Dec 2008 15:52:45 -0600
Reply-To:     Mary <mlhoward@avalon.net>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Mary <mlhoward@AVALON.NET>
Subject:      Re: PROC LOGISTIC: how to run with data with frequencies?
Comments: To: "./ ADD NAME=Data _null_," <iebupdte@GMAIL.COM>
Content-Type: text/plain; charset="iso-8859-1"

Thanks so much.

-Mary ----- Original Message ----- From: ./ ADD NAME=Data _null_, To: SAS-L@LISTSERV.UGA.EDU Sent: Friday, December 05, 2008 3:44 PM Subject: Re: PROC LOGISTIC: how to run with data with frequencies?

767 proc logistic; 768 class allele; 769 model disease/freq = allele; 770 run;

On 12/5/08, Mary <mlhoward@avalon.net> wrote: > I know I've seen it before, but can't seem to find this. > > Is there a way to run PROC LOGISTIC using frequencies instead of > observation-level data? I've got data like this: > > data test; > informat allele $1.; > infile cards; > input allele disease freq; > cards; > A 0 353 > A 1 280 > B 0 424 > B 1 323 > run; > > That I want to run a model of disease=allele with. > > Does anyone know how to do this? > > -Mary > > ----- Original Message ----- > From: Cornel Lencar > To: SAS-L@LISTSERV.UGA.EDU > Sent: Friday, December 05, 2008 3:17 PM > Subject: Re: tphreg with time-varying covariates > > > Hi Deb, > > Try this approach in your model statement: > > do i = 1 to dim(mxs); > if mxs{i} ne . and mxdts{i} ne . and mxdts{i} lt evdt then t_cd = > mxs{i}; > t_cd4cat=1*(tcd ge 0 and t_cd lt 200) + 2*(t_cd ge 200 and t_cd le > 349) + 3*(t_cd ge 350 and t_cd le 499) + 4 *(t_cd ge 500 and t_cd le 649) + > 5*( t_cd ge 650); > end; > > > In your initial code, the variable t_cd4cat was built outside the array so > the model actually didn't see it. Now I think it should work. > > Cheers, > > Cornel > -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On > Behalf Of Kevin > Viel > Sent: Friday, December 05, 2008 1:00 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Re: tphreg with time-varying covariates > > On Thu, 4 Dec 2008 09:29:24 -0600, Deborah Wentworth <debby@CCBR.UMN.EDU> > wrote: > > > Greetings - > > > > I am trying to run my first tphreg model. It's complicated by the fact > > that I have a time-varying covariate. > > > > I cannot find an example of the syntex. The log tells me that "variable > > T_CD4CAT not found". > > > > My code is below. Can someone tell me if I have the incorrect syntax for > > what I am trying to do? Because if's my first stab at tphreg ever, I > > may not be correctly interpreting use of the contrast statement. > > > > Your help would be much appreciated! > > > > Thanks, Deb > > > > proc tphreg data=events; > > class gpa t_cd4cat / ref=first ; > > model t2dth * dth(0) = gpA t_cd4cat gpA*t_cd4cat / risklimits; > > > > contrast 'GpA CD4 cat 1' gpa 1 / estimate=exp; > > contrast 'GpA CD4 cat 2' gpa 1 gpa*t_cd4cat 1 0 0 0 / estimate=exp; > > > > array mxdts{*} mxdt1-mxdt32; > > array mxs{*} cd1-cd32; > > t_cd = cd4bl; /* initially set to baseline */ > > > > do i = 1 to dim(mxs); > > if mxs{i} ne . and mxdts{i} ne . and mxdts{i} lt evdt then t_cd = mxs > > > {i}; > > end; > > > > if 0 le t_cd lt 200 then t_cd4cat=1; > > else if 200 le t_cd le 349 then t_cd4cat=2; > > else if 350 le t_cd le 499 then t_cd4cat=3; > > else if 500 le t_cd le 649 then t_cd4cat=4; > > else if t_cd ge 650 then t_cd4cat=5; > > > > run; > > > > > Hi Deborah, > > Interestingly, we have similar questions: > > PHREG with time-varying covariates > http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0812a&L=sas-l&F=&S=&P=44738 > > I am curious about this line: > > > if mxs{i} ne . and mxdts{i} ne . and mxdts{i} lt evdt then t_cd = mxs{i}; > > > > In your MODEL statement: > > > model t2dth * dth(0) = gpA t_cd4cat gpA*t_cd4cat / risklimits; > > > > the time seems to be t2dth. As I understand PHREG, and for your safety > assume that I do not understand it correctly, the time of interest is > coming from the MODEL statement. > > Also, you *might* be able to omit the baseline assignment statement if > you reconstruct your array to include it as the first value with the > corresponding time of 0? > > HTH, > > Kevin >


Back to: Top of message | Previous page | Main SAS-L page