turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- Base SAS Programming
- /
- Extracting variables from statistical results for ...

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

3 weeks ago

Greetings!

I frequently use proc GLM for repeated measures ANOVA and more recently proc corr for correlational work. In the case of proc GLM I would like to extract various sums of squares and degrees of freedom for other calculations, such power, effect size or ICC. In the case of the proc corr I would like to extract specific correlations in a matrix for further calculations such as confidence intervals or hypothesis testing of different correlation coefficients.

Is there a reference(s) where I can learn how to do this. Or a website of examples I can use to learn how to do this type of programming. I am getting bits and pieces as I search the web but there are gaps that make it impossible for me to figure it out on my own.

Best Wishes,

dg

Accepted Solutions

Solution

3 weeks ago

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to dgabriel

3 weeks ago

you mean using ods?: https://analytics.ncsu.edu/sesug/2002/PS03.pdf

--------------

blog: papersandprograms.com

blog: papersandprograms.com

All Replies

Solution

3 weeks ago

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to dgabriel

3 weeks ago

you mean using ods?: https://analytics.ncsu.edu/sesug/2002/PS03.pdf

--------------

blog: papersandprograms.com

blog: papersandprograms.com

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to PaulBrownPhD

3 weeks ago

Hello. Thank you. That looks pretty darn close. I will have to read it tomorrow morning. Once the variables are extracted, examples have thing "&" in front of the extracted variables and the word "symput". The link is one missing piece; that is, how to identify them to extract them. Thanks once again.

dg

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to dgabriel

3 weeks ago - last edited 3 weeks ago

a very common example is when we need to give the sample size (n) in the table column headings. The code would be something like this (we use "&" because we are making the statistic a macro variable so we can use it elsewhere eg when creating the table or figure):

ods output onewayfreqs=getn;

**proc** **freq** data=temp;

tables treatment;

**run**;

**data** _null_;

set getn;

if treatment=**1** then call symput("trt11",strip(put(frequency,**2.**)));

else if treatment=**2** then call symput("trt2",strip(put(frequency,**2.**)));

**run**;

**proc** **report** data=....;

column .... trt1 trt2 ....;

:

define trt1 / display width=**10** right "Treatment 1 (n=&trt1)";

define trt2 / display width=**10** right "Treatment 2 (n=&trt2)";

:

**run**;

--------------

blog: papersandprograms.com

blog: papersandprograms.com

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to PaulBrownPhD

3 weeks ago

PaulBrown,

The example is exactly the type of thing talking about. I can read the code and see exactly what what you are doing. I have been using SAS for a long time but only for straight forward text book examples. No coding. I so most of my data manipulation like that in MATLAB which learned it organically over 30 years. Now, I am trying to do the same with SAS programming to minimize going back and fourth between programs. That is, use SAS for statistics then type in the results into code written MATLAB for further analysis. The code below illustrates what I am trying to accomplish from beginning to end. Now, I have to apply to ANOVA and correlational work.

Best Wishes,

dg

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to dgabriel

3 weeks ago

If you see the required value in the procedure output, you can get it in an ODS table. Check the Details section of the procedure documentation for the ODS Table Names topic. Add the statement

ODS OUTPUT procTablename=myTableName;

to your code and look at the table contents. The value will be there somewhere.

PG

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to PGStats

3 weeks ago

Thank you very much.

dg

dg

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to dgabriel

3 weeks ago

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

3 weeks ago

Thank is a great reference for the thing I am trying to do.

dg

dg