rdemass Tracker
https://communities.sas.com/kntur85557/tracker
rdemass TrackerSat, 13 Jul 2024 21:56:22 GMT2024-07-13T21:56:22ZRe: How do I keep a variable with a space in its name in the ods output line?
https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-a-variable-with-a-space-in-its-name-in-the-ods/m-p/903044#M356864
Yes, the problem was that I was using labels instead of true variable names. I omitted this but I ran multiple lsmeans /pdiff lines as I actually have more than one predictor variable. Hence why I specified 'x diffs', because there are also 'z diffs', for example. I had used the ods trace to figure this out. And I did in fact want the diffs table, not the lsmeans table (so I do not want output lsmeans).Tue, 14 Nov 2023 19:33:19 GMThttps://communities.sas.com/t5/SAS-Programming/How-do-I-keep-a-variable-with-a-space-in-its-name-in-the-ods/m-p/903044#M356864rdemass2023-11-14T19:33:19ZRe: How do I keep a variable with a space in its name in the ods output line?
https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-a-variable-with-a-space-in-its-name-in-the-ods/m-p/903027#M356861
<P>Yes, I see now that what I was trying to use were the labels. All the variable names are created to have no spaces (e.g., StdErr) and can be kept in the keep line easily.</P>Tue, 14 Nov 2023 18:51:47 GMThttps://communities.sas.com/t5/SAS-Programming/How-do-I-keep-a-variable-with-a-space-in-its-name-in-the-ods/m-p/903027#M356861rdemass2023-11-14T18:51:47ZHow do I keep a variable with a space in its name in the ods output line?
https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-a-variable-with-a-space-in-its-name-in-the-ods/m-p/903023#M356857
<P>I am running a model using proc genmod and have run a lsmeans statement. I would like to save only some of the columns of the lsmeans table using the ods output.</P><P>General setup:</P><PRE>proc genmod data = data;
class x;
model y= x / dist = nb link = log offset = myoff;
lsmeans x / pdiff;
ods output 'x Diffs'=diffs(keep = x Estimate 'Standard Error');
run;</PRE><P>This gives the error that 'Standard Error' is not valid. This is not surprising because it has a space in the variable name.</P><P>I tried specifying as:</P><PRE>ods output 'x Diffs'=diffs(keep = x Estimate 'Standard Error'n);</PRE><P>which adds the 'n' as suggested <A href="https://communities.sas.com/t5/SAS-Enterprise-Guide/dealing-with-space-in-variable/td-p/136173" target="_self">here</A> but that also does not work. There are many variable names in output tables which contain spaces, so understanding how to do this would be very helpful. Thank you</P>Tue, 14 Nov 2023 18:31:39 GMThttps://communities.sas.com/t5/SAS-Programming/How-do-I-keep-a-variable-with-a-space-in-its-name-in-the-ods/m-p/903023#M356857rdemass2023-11-14T18:31:39ZRe: Proc nlmixed GEE for ZINB
https://communities.sas.com/t5/Statistical-Procedures/Proc-nlmixed-GEE-for-ZINB/m-p/892346#M44224
<P><a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633">@StatDave</a> Thanks for the insight. Are you saying there is a way to implement the model I would like in GLIMMIX?</P>Fri, 01 Sep 2023 17:23:19 GMThttps://communities.sas.com/t5/Statistical-Procedures/Proc-nlmixed-GEE-for-ZINB/m-p/892346#M44224rdemass2023-09-01T17:23:19ZProc nlmixed GEE for ZINB
https://communities.sas.com/t5/Statistical-Procedures/Proc-nlmixed-GEE-for-ZINB/m-p/892309#M44219
<P>Hello,</P><P> </P><P>I am looking to fit a GEE ZINB model using proc nlmixed. I have turned to proc nlmixed as neither proc genmod or proc GEE can handle zero-inflated distributions for GEE analysis.</P><P> </P><P>Following SAS sources, such as note 2 <A href="https://support.sas.com/kb/44/354.html" target="_self">here</A> , I believe I can set up the nlmixed statement correctly as needed. However, I am not sure how to specify clustering. In general, my code looks like:</P><P> </P><PRE>proc nlmixed data = data;
/* linear predictor for zero inflation */
eta_zero = a0;
prob_zero = 1/(1 + exp(-eta_zero));
/* linear predictor for negative binomial */;
eta_mean = b0 + b1*dTLN + b2*dNLLN + b3*dT;
mean = exp(eta_mean + myoff);
IF y= 0 THEN lglk = LOG(prob_zero + (1-prob_zero)*(1+(phi*mean))**(1/phi));
ELSE lglk = LOG(1-prob_zero) + y*LOG(phi*mean) - (y+(1/phi))*LOG(1+(phi*mean))
+ lgamma(y+(1/phi)) - lgamma(1/phi) - lgamma(y+1);
model y ~ general(lglk);<BR /> random ??? ;
run;</PRE><P>I understand proc nlmixed can utilize a 'random' statement which can include a subject identifier, but I do not want to include any random effects (I am trying to avoid a linear mixed effects model). I would just like to account for clustering/correlation as a subject can provide more than one response. Note, the data is not a longitudinal study setup.</P><P> </P><P>Is there a way to manipulate the random statement to allow for some correlation structure but not to estimate any random effects, setting up for interpretation as a GEE? Or is there another statement/line in nlmixed I can do this?</P><P> </P><P>Thanks!</P>Fri, 01 Sep 2023 14:46:29 GMThttps://communities.sas.com/t5/Statistical-Procedures/Proc-nlmixed-GEE-for-ZINB/m-p/892309#M44219rdemass2023-09-01T14:46:29ZHow do I view the contrasts SAS uses for Type III tests?
https://communities.sas.com/t5/Statistical-Procedures/How-do-I-view-the-contrasts-SAS-uses-for-Type-III-tests/m-p/869416#M43019
<P><SPAN>I am using SAS proc genmod to fit models. For example,</SPAN></P><PRE>proc genmod data=long_respir descending;
class ID Treatment visit (ref="0");
model y = Treatment visit Treatment*Visit / dist=binomial link=logit type3 wald covb;
repeated subject=ID / withinsubject=visit logor=fullclust;
run;</PRE><P>Where in the model statement specifying 'type3' requests SAS to output Type III tests for each of the predictor variables in the model. My question is: How can I view the contrast statements and 'L' matrix SAS uses to produce its Type III tests?</P><P>To elaborate, if I write my own contrast statement, I can include the '/ e;' at the end to view the 'L' matrix implied by my contrast. I would like to see the 'L' matrix implied by the contrasts SAS uses to produce the Type III tests. I cannot find how I can get SAS to give me that.</P><P> </P><P>I have read the SAS proc genmod documentation for both the model statement and contrast statement and I do not see an option to get what I desire. So, either there is not an option to get this or I am overlooking something.</P>Wed, 12 Apr 2023 14:53:00 GMThttps://communities.sas.com/t5/Statistical-Procedures/How-do-I-view-the-contrasts-SAS-uses-for-Type-III-tests/m-p/869416#M43019rdemass2023-04-12T14:53:00ZRe: How do I specify trend order for PROC lifetest?
https://communities.sas.com/t5/Statistical-Procedures/How-do-I-specify-trend-order-for-PROC-lifetest/m-p/834174#M41302
<P>This does work in the sense that I am not creating a new variable to represent my types. When I implemented this concept, another method is to simply use 'Group 1:...', "Group2:....", Group 3:...." for the formats and include pertinent type info where the ellipses are. This works to order because SAS will order it then by the number ordering. This way also the printout can be descriptive of the original type variable.</P><P>My only dissatisfaction is that this solution still adds unwanted character length to the type names i.e., Instead of simply having 'A', 'B', 'C' in the survival curve graph, we now have 'Group 1: C, 'Group 2: A', 'Group 3: B'.</P><P>I am still wondering if there is a way to assign some inherent value to the type variable that will not show up anywhere aside from having SAS recognize the order.</P><P> </P>Mon, 19 Sep 2022 20:49:37 GMThttps://communities.sas.com/t5/Statistical-Procedures/How-do-I-specify-trend-order-for-PROC-lifetest/m-p/834174#M41302rdemass2022-09-19T20:49:37ZHow do I specify trend order for PROC lifetest?
https://communities.sas.com/t5/Statistical-Procedures/How-do-I-specify-trend-order-for-PROC-lifetest/m-p/833724#M41280
<P>I am wanting to use proc lifetest and run the trend test. </P><PRE>proc lifetest data=work;
time time*censor(0);
strata type / trend test=logrank;
run;</PRE><P>However, my type variable is character, and by default SAS is ordering the different stratas of the variable for the trend test alphabetically. I want to test a different order. I was able to do this as:</P><P> </P><PRE>data work.bios;
set work.bios;
if type="a" then ngroup=3;
if type="b" then ngroup=2;
if type="c" then ngroup=1;
if type="d" then ngroup=4;
run;</PRE><P>and then rerun the proc lifetest stratifying by ngroup. However, I was wondering if there was a way to specify the desired order within the proc lifetest and still use strata type. The reason this would be nice is so the outputted tables and graphs would have the names contained within type. And I would avoid adding more variables to my dataset.</P><P>Thank you</P>Thu, 15 Sep 2022 20:08:57 GMThttps://communities.sas.com/t5/Statistical-Procedures/How-do-I-specify-trend-order-for-PROC-lifetest/m-p/833724#M41280rdemass2022-09-15T20:08:57Z