I simply want to know the number (N) of people
hospitalized by sex and grp.
--- Liyan Liu <firstname.lastname@example.org> wrote:
> Dear fellow SAS professionals,
> I have a dataset with 3 variables
> hosp -- hospitalized for at least once (1,0)
> sex -- m,f
> grp -- 1,2,3
> How could I use the PROC TABULATE procedure to
> a table like:
> m f
> -------------- -------------------
> grp1 grp2 grp3 grp1 grp2 grp3
> Inside the table is the number of people
> Thanks so much.
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
"Liyan Liu" wrote
> I simply want to know the number (N) of people
> hospitalized by sex and grp.
data h;input hosp sex $ grp;
_n=1; *does value 1/0 mean something in hosp?;
*if hosp = 1;
1 m 1
0 m 0
1 f 2
0 f 3
1 m 3
0 m 3
proc tabulate noseps formchar=' ';
class hosp sex grp;var _n;
table sex all, _n='#'*F=3. * (n=' ' pctsum<sex all>='%'*F=6.2) /rts=5
table grp all, _n='#'*F=3. * (n=' ' pctsum<grp all>='%'*F=6.2) /rts=5
table sex*grp all, _n='#'*F=3. * (n=' ' pctsum<sex*grp all>='%'*F=6.2)
Re: labeling columns with 'missing' in proc tabulate #2 Why isn't it practical to change the formats? That sounds like
something that could be automated very easily, either by recreating the
original formats or by creating new ones. The dictionary tables can
tell you which formats apply to which variables, and PROC FORMAT has
CNTLIN= and CNTLOUT= options which allow you to create the old values
and create new ones using SAS code.
You might want to consider whether you can create the same report using
PROC REPORT, which lets you set some titles programmatically.
Manager, Technical Development
Re: Proc Tabulate or Proc Freq or Proc Report Please note the change in my e-MAIL Domain from BIOCON.COM to CLINIGENEINTL.COM.
All future correspondence to me should be addressed to email@example.com
Very sorry, it was copied and pasted from Excel.
Existing data set:
a b c d
1 2 3 45.2
2 2 3 69.8
3 2 3 58.2
1 3 3 56.2
2 3 3 98.6
3 3 3 48.2
a b c d
2 2 3 69.8
2 2 3 98.6
Thanks & Regards,
Re: Proc Report and Proc Tabulate #5 Too funny!
"Perhaps today *is* a good day to die!" Or to use proc
tabulate--whatever's right. ;-)
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Sent: Friday, December 16, 2005 8:20 AM
Subject: Re: Proc Report and Proc Tabulate
In a continuation of this thread, Jonas Bilenas posted, in part:
<<You can read Jonas' entire posting beneath the Sig line>>
> I have a few NESUG and SUGI papers with the title of "Making Sense of
> PROC TABULATE&qu...
Re: proc glm vs proc genmod #2 The general linear model is a special case of the generalized linear model with an identity link function. GENMOD estimates parameters using maximum likelihood methods. SAS GLM and GENMOD results should be very close to one another in most instances if you specify GENMOD with an identity link function:
do i=1 to 200;
y=x + (ranuni(234579)* 0.5);
proc glm data=test;
proc genmod data=test;
model y=x / link=identity;
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.U...
Re: color a cell based on 2 conditions in proc report (character) #2 PS: I have a vague understanding as to the why,
I think it was a little birdie that dropped the
hint a couple years ago, that it has to do with
'timing' when the pieces involved get used. i.e.
Having the variables available in the COMPUTE
blocks to work with and when the CALL DEFINE stuff
performs and the impacts on whether something is
/display or not, gets involved with timing and the
environment layers that proc report steps through.
I can't tell ya exactly, other than that makes
sense based upon what I determined that works and
Re: Proc Tabulate or Report?????? Have you looked at using multlabel formats in PROC TABULATE?
Manager, Technical Development
Metrics Department, First Health
West Sacramento, California USA
>>> "sas maverick" <sas_consultant_iam@YAHOO.COM> 05/26/2004 7:36 PM
I have a dataset with a categorical variable taking values 0 0r 2. I
want to display the freq count , and percent of this variable in
tabular form. But wait hold.... i want the result to be of this format
Re: proc genmod #2 Doris Gerstner <doris.gerstner@MED.UNI-MUENCHEN.DE> wrote
>using proc genmod with the following syntax
>PROC GENMOD data=wtp1 ;
> model t2max= dinco t2pain /DIST = gamma LINK= log;
> output out = resid resdev=res pred=pr;
>some questions arose (I`m a beginner with SAS and generalised linear
>1. the dependent variable (all values >=0) is skewed ==> should I use a log
>transformed dependent or is this done with the link function above?
>2. running the procedure above yielded the following warning:
Re: Proc reg? #2 Peter L. Flom, PhD
Assistant Director, Statistics and Data Analysis Core
Center for Drug Use and HIV Research
National Development and Research Institutes
71 W. 23rd St
New York, NY 10010
(212) 845-4485 (voice)
(917) 438-0894 (fax)
>>> Vijay Wadhwa <vuw100@YAHOO.COM> 04/25/06 5:42 PM >>> wrote
I am trying to do a simple thing but somehow its not happening.. .
I need to analyze some parts for trend, so I fit a regression model,
Y=b0+b1*t, if b1 is significant then I want to output that part as having
Re: Proc Report Janina Nowles asked how to create a report where a single column contains
the PctN statistic at the detail level and the Mean at the summary level.
As an additional twist, the same variable is used as both a classification
variable and an analysis variable.
I think her data needed to be in a different format to make this possible;
the q1 and q2 variables needed to go into a single variable, with an
additional variable (which I called q) used to distinguish them. In
addition, the values for the two sample types needed to go into separate
variables, rather than one variable with a separate var...
Re: proc access question? #2 Actually, I am using SAS8.2, and I did not find some other solution, could
you give me some hints? Thank you.
On 5/22/07, WIELKI Andre <firstname.lastname@example.org> wrote:
> You have many other solutions for excel
> But Proc access is old and linked with the v6 rules
> in peculiar the char length limited to 200!
> change your choice!
> Quoting Amy Sun <tonyliang20032@GMAIL.COM>:
> > Hi, all;
> > I am using PROC ACCESS to import an excel dataset, I have several
Re: PROC FREQ and KAPPA #2 Thanks to Dale Mclerran for his suggestion of using the weight statement and
some very low weight dummy observations to force a square table with all the
desired levels of the response variables.
Rodney J. Presley, PhD
Director of Data Analysis
Georgia Medical Care Foundation
1455 Lincoln Parkway
Atlanta, GA 30346
Re: proc discrim Proc discrim calculates linear functions for every group. For instance if
you have two groups: "A" and "B" than proc discrim creates two functions
(one for each group). Than proc discrim calculates values of those
functions for every observation in the data set. If value of function "A"
is grater than value of function "B" then observation belongs to group "A"
and vice versa.
Consider the following example:
input x group $;
proc discrim data = test ;
You can find t...
Re: proc sql blank column #2 The code I posted comes from a macro which queries a library. The macro is
called once per dataset with the dataset name passed in as a parameter. I
just hard-coded a couple of datasets to keep things simple for my posting.
The results are concatenated into a single dataset, and I need to have all
library members appear in that dataset, whether they have obs or not.
Re: Proc format On Sun, 25 Jul 2004 16:59:17 PDT, Wei Yen <weiyen@UCLA.EDU> wrote:
>Does anyone have a quick answer to this question? In proc format, when
>specifying numeric values, the OTHER statement can be used to lump
>together values that are not specified previous. What is the equivalent
>of the OTHER statement in specifying charater values? TIA.
It is also OTHER. Specify without quotes as below (not tested):
proc format ;
value $split "a" - "m" = "first half"
other = "second half" ;
Re: proc factor with missing data? #2 4043 Peter,
Thank you very much.
Dennis G. Fisher, Ph.D.
Professor and Director
Center for Behavioral Research and Services
California State University, Long Beach
1090 Atlantic Avenue
Long Beach, CA 90813
tel: 562-495-2330 x121
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Peter Flom
Sent: Wednesday, March 03, 2010 1:30 PM
Subject: Re: proc factor with missing data?
Dale McLerran <stringplayer_2@YAHOO.COM> wrote (in part)
>I would not pass data from MI into a fact...
Re: use of class statement in proc logistic #2 Nikhil,
What a class statement is doing is forming "dummy" variables to use in the
model. For instance, the logistic regression coding:
proc logistic data=set1;
class sex(param=ref ref='M');
model disease=sex var1 var2;
Would form one dummy variable for sex with values 0 for Male (because it was
the reference variable), and 1 for Female. If you have more than two
values, it would form one less dummy variable than you have values (i.e.,
two for 3 categories). It is probably a good idea to use reference coding
to start as I'm doing above, as effect co...
Re: Data Step vs. Proc sql #2 Return of the Jedi?
On Thu, 26 Feb 2004 23:36:46 +0000, Ian Whitlock <iw1junk@COMCAST.NET>
>Thanks for clarifying the discrepancy between what was asked of the two
>However, I think you went to far with
> merge a(in=ina) b(where=(x <= 499));
>The value 499 was not given directly to the SQL step, although it found it
>used it. I think a still fairer comparison would be to obtain the 499 as a
>macro variable in a preparatory DATA step acting on A to find the maximum X
>needed and then using
> merge ...
Re: Calculating a pagebreak variable for use in proc report #2 Hi Data _Null_,
This is a teriffic solution! Thanks so much for your help.
Was hoping you could explain how the eq 1 part works. Think this might be b=
oolean logic or something but not sure if I have the right term.
--- On Mon, 10/6/08, ./ ADD NAME=3DData _null_, <email@example.com> wrote:
From: ./ ADD NAME=3DData _null_, <firstname.lastname@example.org>
Subject: Re: Calculating a pagebreak variable for use in proc report
Date: Monday, October 6, 2008, 4:28 PM
For this sort of grouping MOD has be he...
Re: PROC SQL vs DATA STEP Question #2 Charles:
I don't like the looks of the SAS SQL V9.1 manual's textbook solution to the
'key set complement' problem. The fact that it unnecessarily generates
warning messages just scratches the surface.
Whereas I had formerly preferred the simple query form,
select * from <whatever> where key not in (select key from
Master Whitlock noted that it did not support composite keys
naturally, and that SAS SQL optimization generally favors joins over set
operations. He demonstrated that in a wide variety of circumstances the