megalops Tracker
https://communities.sas.com/kntur85557/tracker
megalops TrackerTue, 28 May 2024 13:57:06 GMT2024-05-28T13:57:06ZRe: Filter data so only relevant rows remain
https://communities.sas.com/t5/SAS-Procedures/Filter-data-so-only-relevant-rows-remain/m-p/196954#M49209
<HTML><HEAD></HEAD><BODY><P>It worked!!! Thanks!!!</P></BODY></HTML>Tue, 11 Aug 2015 18:55:52 GMThttps://communities.sas.com/t5/SAS-Procedures/Filter-data-so-only-relevant-rows-remain/m-p/196954#M49209megalops2015-08-11T18:55:52ZFilter data so only relevant rows remain
https://communities.sas.com/t5/SAS-Procedures/Filter-data-so-only-relevant-rows-remain/m-p/196952#M49207
<HTML><HEAD></HEAD><BODY><P>I am struggling to explain my problem. Hopefully my details below will be clear enough to understand. </P><P></P><P>I have a large dataset with many rows. I have redundancy in one of the columns and I want to reduce them. Below is an example of my dataset with redundant rows. </P><P></P><P>Name Number</P><P>John 55</P><P>John 55</P><P>John 55</P><P>Ken 21</P><P>Ken 21</P><P>Ken 21</P><P>Ken 21</P><P>Steve 46</P><P>Steve 46</P><P></P><P>I don't want to lose the Number for each name. I just want to reduce the repeat columns with the Number. </P><P></P><P>I want to filer the date so the redundant rows are removed and I end up with the following:</P><P>Name Number</P><P>John 55</P><P>Ken 21</P><P>Steve 46</P><P></P><P></P><P>Any help would be GREATLY appreciated. </P></BODY></HTML>Tue, 11 Aug 2015 17:57:01 GMThttps://communities.sas.com/t5/SAS-Procedures/Filter-data-so-only-relevant-rows-remain/m-p/196952#M49207megalops2015-08-11T17:57:01ZRe: Output of statistics
https://communities.sas.com/t5/SAS-Procedures/Output-of-statistics/m-p/83396#M23955
<HTML><HEAD></HEAD><BODY><P>Thank you to both of you for the excellent solutions to my problem. </P><P></P><P>TomKari, can you explain to me what these three lines of code are doing? Thanks again for your help. </P><P></P><P>if first.person then person_tasks = "";</P><P>person_tasks = cats(person_tasks, task);</P><P>if last.person then output;</P></BODY></HTML>Wed, 03 Oct 2012 13:37:57 GMThttps://communities.sas.com/t5/SAS-Procedures/Output-of-statistics/m-p/83396#M23955megalops2012-10-03T13:37:57ZOutput of statistics
https://communities.sas.com/t5/SAS-Procedures/Output-of-statistics/m-p/83393#M23952
<HTML><HEAD></HEAD><BODY><P><SPAN style="font-size: 12.0pt; font-family: 'Times New Roman','serif';">I am struggling to clearly write my question so please hang in there. I have a dataset that has a column of unique identification numbers. This column is called “person”. Then I have a column called “tasks” that lists individual tasks for the unique person. The tasks are provides as text such as tasks A,B, and C. There in only one task listed for each row. So if person 5 did three tasks then there are three rows for person 5. It looks like this: </SPAN></P><P><SPAN style="font-size: 12.0pt; font-family: 'Times New Roman','serif';">Person tasks</SPAN></P><P><SPAN style="font-size: 12.0pt; font-family: 'Times New Roman','serif';">5 A</SPAN></P><P><SPAN style="font-size: 12.0pt; font-family: 'Times New Roman','serif';">5 B</SPAN></P><P><SPAN style="font-size: 12.0pt; font-family: 'Times New Roman','serif';">5 C </SPAN></P><P><SPAN style="font-size: 12.0pt; font-family: 'Times New Roman','serif';">I am trying to get SAS to provide a summary of statistics that will tell me how many persons only completed task A, how many persons completed both tasks A and B, how many persons completed both tasks A and C, and so on to cover all the other combinations of tasks. I don't care about the task of specific individuals. I just want to know the overall statistics on the number of individuals of how many persons did the tasks. </SPAN><SPAN style="font-size: 12.0pt; font-family: 'Times New Roman','serif';">My attempts with proc means were unsuccessful and I would greatly appreciate any help with this project. <BR /></SPAN></P></BODY></HTML>Tue, 02 Oct 2012 19:57:34 GMThttps://communities.sas.com/t5/SAS-Procedures/Output-of-statistics/m-p/83393#M23952megalops2012-10-02T19:57:34ZRe: Proc tabulate question
https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-question/m-p/12186#M1583
My bad. I do get an error message. The message says: <BR />
<BR />
ERROR 22-322: Syntax error, expecting one of the following: ;, ALLDUPS, CNTLIN, CNTLOUT, DDNAME,FMTLIB, INDD, LIB, LIBRARY, MAXLABLEN, MAXSELEN, NOREPLACE, NOTEXT82, OUT, OUTDD,PAGE.<BR />
<BR />
ERROR 76-322: Syntax error, statement will be ignored.<BR />
<BR />
I believe the error is comming from the following line of code: <BR />
<BR />
value $sp(multilabel notsorted)<BR />
<BR />
I do not understand what $sp(multilabel notsorted) means. Is the (multilabel notsorted) a note that should be excluded from the code?Tue, 14 Jun 2011 20:33:09 GMThttps://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-question/m-p/12186#M1583megalops2011-06-14T20:33:09ZRe: Proc tabulate question
https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-question/m-p/12184#M1581
I am stuck. I don't get any error messages yet SAS does not provide the aggreate sum of the three species. <BR />
<BR />
First, I already read in a spreadsheet into SAS with the weight of different species. I called the data sarec. I have over 4,000 records with 10 different species. <BR />
<BR />
I defined my species and my aggregate of three of the species with the following proc format code:<BR />
<BR />
proc format data=sarec;<BR />
value $sp(multilabel notsorted)<BR />
'black grouper'='black grouper'<BR />
'red grouper'='red grouper'<BR />
'gag'='gag'<BR />
'black grouper','red grouper','gag'='Black, Red, and Gag grouper'<BR />
'golden tilefish'='golden tilefish'<BR />
'red snapper'='red snapper'<BR />
'snowy grouper'='snowy grouper'<BR />
'speckled hind'='speckled hind'<BR />
'vermillion snapper'='vermillion snapper'<BR />
'warsaw grouper'='warsaw grouper';<BR />
run;<BR />
<BR />
Then I added the format code to my proc tabulate with the code below. new_com is the column in my dataset with the species names. <BR />
<BR />
format new_com $sp.;<BR />
<BR />
The proc tabulate provided the sum of weights for each species but did not provide a sum of weights of my three species aggregate (Black, Gag, and Red grouper). <BR />
<BR />
Any advice would be greatly appreciated.Tue, 14 Jun 2011 18:37:46 GMThttps://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-question/m-p/12184#M1581megalops2011-06-14T18:37:46ZRe: Proc tabulate question
https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-question/m-p/12180#M1577
I am sorry, I am struggling with the multilabel format. <BR />
<BR />
Is there some text I can add to the tables statement telling sas to do an additional sum of only certain species?Mon, 13 Jun 2011 15:01:25 GMThttps://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-question/m-p/12180#M1577megalops2011-06-13T15:01:25Zdeviance value for Proc Genmod
https://communities.sas.com/t5/Statistical-Procedures/deviance-value-for-Proc-Genmod/m-p/11930#M164
I am running two different genmod models: One is for a binomial distribution and the other is for a normal distribution. My SAS code is very similiar for the two models. However, the output for the binomial distribution does not give me all of the goodness of fit information that I need. Specifically, the binomial distribution output does not give me the criterian of deviance, scaled deviance, pearson chi-square, and scaled pearson X2. Yet, the output for the normal distribution does give me values for these 4 criteria. ??? I need to find out how to get the criterian listed in the output for the binomial model. <BR />
<BR />
You will see that the SAS code for the two different model runs is very similiar. <BR />
<BR />
Here is my SAS code for the binomial distribution:<BR />
<BR />
proc genmod data=analysis desc;<BR />
model success = / dist = bin link = logit type3;<BR />
run;<BR />
<BR />
Here is my SAS code for the normal distribution:<BR />
<BR />
proc genmod data=analysis desc;<BR />
model cpue = / dist = normal link = identity type3;<BR />
run;<BR />
<BR />
Any help on how to get SAS to report the 4 criteria for the binomial distribution would be greatly appreciated.Mon, 13 Jun 2011 14:49:15 GMThttps://communities.sas.com/t5/Statistical-Procedures/deviance-value-for-Proc-Genmod/m-p/11930#M164megalops2011-06-13T14:49:15ZProc tabulate question
https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-question/m-p/12178#M1575
I am learning SAS and this is my first post on the forum. I hope I can crearly explain my problem. <BR />
<BR />
I used Proc Tabulate to sum up the weight for a fish species. It worked great, but I need to also add an aggregate sum of two of the species. Here is the layout of the table that I already have: <BR />
<BR />
species weight<BR />
X 25<BR />
Y 20<BR />
Z 34<BR />
<BR />
I want to add an extra row. Here is a layout of the table that I want: <BR />
<BR />
species weight<BR />
X 25<BR />
Y 20<BR />
Z 34<BR />
X+Y 45<BR />
<BR />
<BR />
The problem is that I don't know how to get proc tabulate to add the extra row of specis X and Y. I am assuming I need to add something to the tables statement of the procedure but I am not sure. <BR />
<BR />
Any help would be greatly appreciated.Mon, 13 Jun 2011 14:03:02 GMThttps://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-question/m-p/12178#M1575megalops2011-06-13T14:03:02Z