f



manipulating Proc SurveyFreq ODS table output

I need to take the table output (ODS label is CrossTabs) and re-arrange it
so it looks similar to the Proc Freq crosstabs, with each box having the N,
overall percent, Row Percent, Column Percent.  I'd also like to add in the
confidence limits for the row and column percent.

Has anyone done this?

I'm thinking that the use of pointer controls may help me place things in
the columns I need, though of course a Proc Transpose approach might work
too.

The data source will be Ohio's BRFSS data.  I'm working towards a macro
which will let me get the crosstabs table, manipulate it to cleanup
significant digits, and then put it on the page in the desired layout.
Then I'll be running the h*!! out of it to create all my tables.

You advice and suggestions are appreciated.

Thanks.

BJ Mattson
Epidemiology Investigator III
Ohio Department of Health
Center for Public Health Statistics and Informatics.
0
bj.mattson (11)
1/21/2009 5:47:07 PM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

0 Replies
673 Views

Similar Articles

[PageSpeed] 33

Reply:

Similar Artilces:

Re: manipulating Proc SurveyFreq ODS table output
Yes, I do a great deal of this; mostly this will involve pulling what you need from ODS data sets, and then you can merge them back together to get the structure that=20 you need, or sometimes I'll pull the one thing that I want from an ODS data set and put it into a macro variable, then combine them back into a data set.=20 data crosstabfreqs_set; informat disease $1. table $256. frequency 8. ; stop; run;=20 ods output CrossTabFreqs=3Dcrosstabfreqs_set; proc freq data=3Dset1 ; tables disease * &snp; title &snp; run; data control_allele1; set crosstabfreqs_set; where disease=3D'0' and &snp=3D'0'; table=3Dtrim(substr(table,index(table,'*')+1,length(table))); rename frequency=3Dcontrol_allele1_freq; keep table frequency; run; data control_both; set crosstabfreqs_set; where disease=3D'0' and &snp=3D'1'; table=3Dtrim(substr(table,index(table,'*')+1,length(table))); rename frequency=3Dcontrol_both_freq; keep table frequency; run; data mergeset; merge control_allele1 control_both; by table; run; Another thing that you can do is to pull certain variables out of=20 an ODS data set and put it into a macro variable: %let likelihood=3D.; proc sql noprint; select likelihood into :likelihood from globaltests_set; quit; %put Likelihood=3D &likelihood; proc sql; create table results as select &likelihood as likelihood format 16.12 .... quit; -Mary ----- Orig...

Re: manipulating Proc SurveyFreq ODS table output #3
It looks like you are headed in the right direction. I would consider = using Proc Report rather than put statements to print it; once you get that going then you can put it = into a macro and use macro variables to label the table name and footers. It is not really a good = idea to use a data set to hold the entire report; just let it hold the data and then use proc = report to generate the data the way you want it. Good luck! -Mary ----- Original Message -----=20 From: BJ Mattson=20 To: SAS-L@LISTSERV.UGA.EDU=20 Sent: Thursday, January 22, 2009 2:55 PM Subject: Re: manipulating Proc SurveyFreq ODS table output Here's what I've got so far. I still need to figure out how to get = the maximum values for the row & column variables, then add 1 to represent = the totals, plus programmatically enter the table name at the top, and any desired footers. Once I get it working with named variables, then I = move on to macro variables so it can run dynamically. Your suggestions and advice are appreciated. BJ Mattson Epidemiology Investigator III Ohio Department of Health proc surveyfreq data=3Dbrfss07.testmisfix nosummary; tables _BMI4cat * GENHLTH / cl col row wtfreq ; ods output CrossTabs=3Dbrfss07.BMI4GENHLTH ; weight _finalwt; title1 "BRFSS 2007: GENHLTH and obesity"; run; data brfss07.cleanedBMI4GENHLTH ; set brfss07.bmi4GENHLTH ; array cleanup (12) Percent StdErr LowerCL Up...

Re: manipulating Proc SurveyFreq ODS table output #4
On Thu, 22 Jan 2009 15:09:39 -0600, Mary <mlhoward@AVALON.NET> wrote: It looks like you are headed in the right direction. I would consider using Proc Report rather than put statements to print it; once you get that going then you can put it into a macro and use macro variables to label the table name and footers. It is not really a good idea to use a data set to hold the entire report; just let it hold the data and then use proc report to generate the data the way you want it. Good luck! >-Mary -------------------------------------------------------------- Mary The data are processed in Proc SurveyFreq first, then sent via ODS to an output table. Essentially, the table _is_ the report, just not laid out the way I want it. It comes out looking somewhat like this, depending on what output you requested: GENHLTH _BMI4CAT Freq Percent Std Err of Percent etc Excellent Neither overweight nor obese 888 9.3899 0.4417 ... Overweight 600 6.0075 0.3315 ... Obese 244 2.4621 0.2167 ... Don’t know/Refused/Missing 57 0.5607 0.1213 ... Total 1789 18.4201 0.5629 ... And what I wanted was a Proc Freq-like output: Excellent ... other values -> Neither overweight nor obese in columns Frequency 888 Weighted N 826,279 ...

Re: manipulating Proc SurveyFreq ODS table output #2
Here's what I've got so far. I still need to figure out how to get the maximum values for the row & column variables, then add 1 to represent the totals, plus programmatically enter the table name at the top, and any desired footers. Once I get it working with named variables, then I move on to macro variables so it can run dynamically. Your suggestions and advice are appreciated. BJ Mattson Epidemiology Investigator III Ohio Department of Health proc surveyfreq data=brfss07.testmisfix nosummary; tables _BMI4cat * GENHLTH / cl col row wtfreq ; ods output CrossTabs=brfss07.BMI4GENHLTH ; weight _finalwt; title1 "BRFSS 2007: GENHLTH and obesity"; run; data brfss07.cleanedBMI4GENHLTH ; set brfss07.bmi4GENHLTH ; array cleanup (12) Percent StdErr LowerCL UpperCL ColPercent ColStdErr ColLowerCL ColUpperCL RowPercent RowStdErr RowLowerCL RowUpperCL; do i = 1 to 12; if missing(cleanup(i))=0 then cleanup (i) = round(cleanup(i),.1); end; drop i; format frequency WgtFreq comma9.0 Percent StdErr LowerCL UpperCL ColPercent ColStdErr ColLowerCL ColUpperCL RowPercent RowStdErr RowLowerCL RowUpperCL 4.1; * assign the max value of the var +1 to replace missing value in totals; if missing(GENHLTH) = 1 then GENHLTH = 6; * need to programmatically assign max of Genhlth + 1 ; if missing(_BMI4cat)= 1 then _BMI4cat = 4; *...

Re: ods output in proc freq: how to generate multiple ods tables #3
One thing you could consider actually is the following: ods output OneWayFreqs = h(where=(table="Table Height")); ods output OneWayFreqs = w(where=(table="Table Weight")); proc freq data=sashelp.class; tables height; tables weight; run; ods output close; That will accomplish exactly what you wanted, I think. You just have to think about how ODS works; it creates a new output stream. You can create two of them, and then use dataset options to limit what is kept. -Joe On Sat, Jul 18, 2009 at 1:51 AM, John(Jiangtang) Hu <jiangtanghu@gmail.com>wrote: > Thank you...

SAS proc mixed: ODS output convergencestatus
Helen C. Dennis Education Associate Assessment and Analysis Group Delaware Department of Education P.O. Box 1402 Dover, DE 19903-1402 Tel: (302)739-6700 Fax: (302) 739-3092 email: hdennis@doe.k12.de.us Does anyone know what "pdh" and "pdg" stand for? (pdh and pdg are two of the variable names in the ODS ouput for "convergencestatus" ) thanks! Helen, I believe that pdG and pdH are indicators that the covariance matrix is positive definite and that the hessian is positive definite. Here is an example where the covariance matrix is not p.d. and the variable pdG has...

Re: proc crosstab (SUDAAN) versus SAS proc surveyfreq
according to the author of an SGF seminar SAS and Sudaan differ in their handling of missing data Here is a resource: http://www.sascommunity.org/wiki/Survey_Sampling according to Siller and Tompkins the Big Four produce the same results (accurate to N decimal places) The Big Four: Analyzing Complex Sample Survey Data Using SAS(r), SPSS(r), STATA(r), and SUDAAN(r) http://www2.sas.com/proceedings/sugi31/172-31.pdf see also papers by SAS-L whizard and Hall-of-Fame peer: David Cassell .... Tricks w/Proc SurveySelect http://www2.sas.com/proceedings/forum2008/114-2008.pdf Ronald J. Fehd, IT S...

proc gplot output to .rtf become smaller than SAS output window, why?
The graph in SAS output window looks nice, but after output to .rtf, it becomes very small, and legend display as to 1 across. How can I get the same graph as SAS output window? thanks. The warning from log: WARNING: TITLE1 is too long. Height has been reduced to 57.29 pct of specified or default size. WARNING: There is not enough room to use the specified ACROSS=4. It was only possible to fit 1 legend entries across. The default will be used. my code: symbol1 w=1.5 value=dot height=0.5 interpol=spline color=black; symbol2 ...; symbol3 ...; symbol4 ...; symbol5 ...; symbol6 ...; symbo...

outputting surveyfreq tables
Hi all, I want to bump my proc surveyfreq output tables over into Excel. Looking at the ODS documentation, it seems that I need an output dataset from surveyfreq. How do I do this? Cheers L_B "The beggar laughs in the face of the thief" _________________________________________________________________ House hunt online now! http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fninemsn%2Erealestate%2Ecom%2Eau%2Fcgi%2Dbin%2Frsearch%3Fa%3Dbhp%26t%3Dres%26cu%3DMSN&_t=758874163&_r=HM_EndText_Oct06&_m=EXT Beggar , You never state which tables you want outputted to Excel. Proc Su...

SAS ODS output
I try to use "ods output" to get sum of squares, although worked well with small dataset, but it crashes all the time when dealing with our large datasets. Wonder if anyone could help? ods output anova = project.half_year_anova FitStatistics = project.half_year_fit ParameterEstimates =project.half_year_para; proc reg data = project.year_returns_step3; model funds_return = sp500_return; by cusip year half; run; ods output close; run; quit; ERROR: Expecting page 6, got page -1 instead/ ERROR: Page validation error while writing WORK._TF001.ITEMSTOR ERROR: File WORK._TF0001.ITE...

ODS output with proc template
Dear SAS-L'ers, I'm trying to retreive all styles in the current ods path, together with their libraries and the bitmap file names. Unfortunately, the following code provides neither the libraries nor the file names : ODS output STATS=StyleList; proc template; list; run; ODS output close; My goal is to build a SAS/AF treeview with the list of available styles presented by library and file name: LIB1 | +--File1 | | | +---Style1 | | | +---Style2 | LIB2 Alternately, a way to retrieve programmatically the complete content of the current ODS PATH (not the ODS PATH SHOW) would help. Your suggestions will be welcome Rivo. ...

Framing SAS Proc Output
We are sometimes confronted with the need to produce output in a rigidly specified format, mostly specified by a sponser request or FDA regulation. It often seems to me that the output needed is "proc xxx +". For example, xxx is often "report" plus some output above and/or below it. Tabulate is another frequent value of xxx. The problem comes when the needed output is sufficiently data-driven that title and footnote statements aren't flexible enough. I've seen solution code that goes to the listing destination and involves running the proc with a reduced pagesize followed by elaborate post-processing. Once we even punted and wrote a special-purpose VB program; it could have been fortran in the 70s. This approach seems clumsy to me. Can anyone suggest some method of still allowing the proc to do the layout, but adding things, probably using ODS. My ODS skills are still not what they might be, although I'm working on it. Thanks in advance for any suggestions. Jonathan ...

output table with proc freq
hello i easily output statistics on table for continuous variables using proc univariate or proc means output statment. I would like to do the same for categorical variable. I would like for example to export on a sas table, frequency of each category. i don't know how to do that with proc freq. ...

SAS ODS EXCEL OUTPUT
Hi, Im having a problem using the headtext= in sas ods... i want to spread headers and footers over multiple lines... Does anyone know if this is possible... Also i do not run the sas program on windows platform. The code im using looks like this... headtext= '<style> @Page {mso-header-data:"&Lxxx &Cxxx &RPage &P of &N "; mso-page-orientation:landscape; mso-footer-data:"&Lxxx - &D/&T "}; </style>'; But i want my header like this... XXX title page 1 of 3 YY ...

Re: ods rtf output: how to increase output width? (was ods rtf
Thanks for posting the code, glad you finally realize why people ask the code or log, because it really helps to answer the original question. Anyway, as I explained in my previous email, your way of using ODS with data _null_ is one of the two ways. Many people don't realize that it is not the preferred ODS + data _null_ reporting method. However, it dose retain most of the old data _null_ reporting flexibility. The reason why there is a big gap between these two data _null_ output is that because it is generated by two steps. SAS always add some space between two steps output, even though you have startpage=never. It is not easy to get rid of the space if you use preferred method (put _ods_), but for the old method, there is actually a workaround: options orientation=landscape leftmargin="0.5 in" rightmargin="0.5 in"; ods rtf file='c:\temp\junk.doc' startpage=never style=rtf; options ls=160; filename xx temp; data _null_; file xx; raw_value = 3.4; count = 1025; freq = 23.7; put @1 "BME measurement" @82 raw_value @118 count @128 freq; run; data _null_; file xx mod; raw_value = 2.2; count = 2222; freq = 22.2; put @1 "BME measurement" @62 raw_value @88 count @128 freq; run; data _null_; file print; infile xx; input; put _infile_; run; ods rtf close; Try run this and yoou can see, the output from two data steps are put together wi...

Proc Reg, by class, and ods output
Dear all: I want to run a regression by class with selection = ADJRSQ and best = 1; i want the output of the parameter estimates of the best model for each of the classes that I have in my regression My code for outputting the Parameter estimates for the general regression did not work when i started regressing by class...the code for the general regression was as follows: ods output ParameterEstimates=y; proc reg data = x ; by class; /* THIS IS WHAT I WANT */ model VARA = {Fixed T_plus_5 T_plus_3 T_Plus_2 } VARB VAR C VAR D / ADJRSQ ACOV SELECTION = ADJRSQ BEST = 1; ods output close; proc...

Ods output object table names
From time to time on the list, anybody is searching how to capture part of the output of a procedure I discover that from page 430 to 511 of "Sas9.1 Output delivery system" you have the list of the names/description/ and options which generate them proc by proc A handfull paper excerpt you may print You get it at http://support.sas.com/documentation/onlinedoc/91pdf/index_912.html (only printable with Acrobat Reader 6 and not wih acrobat full 5! HTH Andre ...

Re: output table with proc freq
On Mon, 20 Oct 2008 12:42:59 -0700, sofiane <mesbah.sofiane@GMAIL.COM> wrote: >hello > >i easily output statistics on table for continuous variables using >proc univariate or proc means output statment. > >I would like to do the same for categorical variable. I would like for >example to export on a sas table, frequency of each category. i don't >know how to do that with proc freq. Have you looked at the PROC FREQ documentation? ...

Re: Framing SAS Proc Output
Read up on Proc Template... that along with ODS is the best way to customize your Proc (whatever) output, generally. It allows you to customize the proc's layout without abandoning the default layout entirely. -Joe On Fri, Feb 27, 2009 at 9:15 AM, Jonathan Goldberg <jgoldberg@biomedsys.com>wrote: > We are sometimes confronted with the need to produce output in a rigidly > specified format, mostly specified by a sponser request or FDA > regulation. It often seems to me that the output needed is "proc xxx +". > For example, xxx is often "report" plus some output above and/or below > it. Tabulate is another frequent value of xxx. > > The problem comes when the needed output is sufficiently data-driven that > title and footnote statements aren't flexible enough. I've seen solution > code that goes to the listing destination and involves running the proc > with a reduced pagesize followed by elaborate post-processing. Once we > even punted and wrote a special-purpose VB program; it could have been > fortran in the 70s. > > This approach seems clumsy to me. Can anyone suggest some method of still > allowing the proc to do the layout, but adding things, probably using > ODS. My ODS skills are still not what they might be, although I'm working > on it. > > Thanks in advance for any suggestions. > > Jonathan > ...

ods proc report output empty
I give up. for some reason my html report below is empty. ods listing close; ods html body='file.html'; proc report data=data ; column var1 var2 var3; define var1 / order ; run; ods html close; quit; I've tried any number of arrangments even copied some ods code that works and still nothing. What is wrong? ...

ODS output error with Proc GLMselect
Hi all, On SAS 9.1.3, I've used the experimental procedure Proc GLMselect for a while without any problem until recently. Now, I'm getting the following error when I attempt to save output files via ODS from GLMselect procedure. ------------------------------------------------------------------------------------------------------------------------------------------------- ERROR: Unable to restore 'Stat.GLMSELECT_Exp.ModelInfo' from template store! ERROR: Unable to restore 'Stat.GLMSELECT_Exp.NObs' from template store! ERROR: Unable to restore 'Stat.GLM...

Re: ODS output with proc template
I inspected all views in the SASHELP library and I found out that SASHELP.VSTYLE contains all the information I needed about the styles in the active ODS PATH. I wish this might help others. ...

SAS table output XML/XSL
Hi, From SUGI paper, I know we can generate SAS table into XML. I am wondering if we could automately generate accompany XSL so that I can put it on the web. The problem is I don't know much about DTD/Shema namepacing used by SAS institute. Thanks Eric ...

how to control decimals in proc surveyfreq output?
Is there one option like in proc means (maxdec=2)? Thanks in advance, Adriano ...

Web resources about - manipulating Proc SurveyFreq ODS table output - comp.soft-sys.sas

A parasitoid wasp manipulating the brain of a cockroach - YouTube
The parasitoid wasp Ampulex controls the cockroach's behaviour for the benefit of its own offspring. The wasp's venom inhibits parts in the cockroach's ...

Doctor Mervyn Jacobson jailed for a year for manipulating the sharemarket
A doctor who once claimed to be worth $100 million has been jailed for a year for manipulating the sharemarket for financial gain.


Doctor Mervyn Jacobson faces lengthy jail sentence after being found guilty of manipulating stock market ...
He has been praised by American presidents and British lords for his wildlife conservation efforts, and claims to have saved the brush-tailed ...

Brighton doctor Mervyn Jacobson found guilty of manipulating the stock market
... of 35 charges on Wednesday, after an eight-week trial. A doctor who claimed to have a $100 million fortune has been found guilty of manipulating ...

Australia accused of manipulating Australian dollar to save iron ore miners
... iron ore miners are so desperate for cash that ''even the kangaroos are for sale". An American iron ore miner says Australia is "manipulating" ...

Government accused of manipulating science news
The federal government engages in "unacceptable political interference" in the communication of government science, says the head of a group ...

Commentary: Japan's Abe manipulating a dangerous coup against pacifist Constitution
TOKYO,June30JapanesePrimeMinisterShinzoAbeismanipulatingadangerouscouptooverturnthecountry'spost-w

Over 50 US military analysts say Pentagon is manipulating Daesh reports
Over 50 US military analysts say Pentagon is manipulating Daesh reports

Volkswagen ordered to recall nearly 500,000 vehicles for manipulating software to circumvent emissions ...
Volkswagen has been manufacturing cars that only fully deploy their emissions control systems when they are undergoing fuel emissions inspection, ...

Resources last updated: 3/16/2016 1:13:00 PM