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
- /
- Analytics
- /
- Stat Procs
- /
- How to Calculate LS Mean,95%CI and p-value.

Topic Options

- Subscribe to 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
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-25-2013 06:43 AM

Hi All.

As i am regular user for Base SAS,SQL and Macros but i did't come across to Statistical procedures.

Today my client came up with me a report ,in that i need to show some statistical columns which are LS MEANS ,95%CI and p-value.

CLient requirement looks likes bellow..

Actlevel | N | mean | SD | LS MEAN | 95 % CI | p-value |
---|---|---|---|---|---|---|

HIGH | xx | xx.x | xx.xx | xxx.xx | (xx.xx,xx.xx) | x.xxxx |

LOW | xx | xx.x | xx.xx | xxx.xx | (xx.xx,xx.xx) | x.xxxx |

MOD | xx | xx.x | xx.xx | xxx.xx | (xx.xx,xx.xx) | x.xxxx |

Could you please provide sample code to get above statistics as i dod't have much time to go through the statistical procedures.

please use SASUSER.ADMIT dataset to generate above table then i can adopt that code for my original dataset.

Any help** you can give **would be greatly appreciated

Note :

**Confidence Interval from the ANCOVA model.**

** $=p-Value from the ANCOVA model. **

**Thanks &Regards.**

**Sanjeev.K**

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

06-25-2013 08:12 AM

Hi.

I don't have access to sasuser.admit;

so,I used sashelp.class (which is not suitable for what you want, but it will give you an idea);

proc glm data = sashelp.class;

class sex; *need to put your group variable in the class statement

model age = sex;

lsmeans sex/stderr cl;

run;quit;

Good luck!

Anca.

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

06-25-2013 09:01 AM

Hi Anca ..

thank you so much for your rply..

here i am attaching Admit Dataset. Could you please try on this.

and i have few quires on your provided solution..

>Is this values based on ANCOVA model ???

>Is this possible to get output dataset with these values ???

once again thank you for your response ..

Regards.

Sanjeev.K

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

06-25-2013 09:49 AM

So, here is for example one link that shows ANCOVA analysis with SAS:

http://www.stat.sc.edu/~hitchcock/crackersasexample.txt

and this one:

SAS/STAT(R) 9.2 User's Guide, Second Edition

What I need to know from you is what is your X (independent variable) and what is your Y (dependent variable)? I assume that your X is the ActLevel (as per the sasuser.admit data set).

But what is the Y?

What I mean is that you need to set up a (simple) model where the group variable is your X and you need a Y so you can conclude if there are differences in Y between the X's groups.

Anyway....

Yes, there are ways to output the results by using either ods statement or the output out...