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
- /
- SAS Procedures
- /
- calculate pooled sigma

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

05-21-2015 09:42 PM

given dataset below, i want to compute the pooled sigma by Group. Already tried Ttest but it is limited to two class variables

Group | COUNT | MEAN | SIGMA | MEAS_DATE |

a | 501 | 101.1664 | 12.62792 | 14-Apr-15 |

a | 123 | 103.33 | 10.545 | 8-Apr-15 |

b | 164 | 99.21071 | 16.14705 | 8-Apr-15 |

b | 697 | 86.24266 | 9.794989 | 9-Apr-15 |

c | 223 | 82.22 | 7.422 | 7-Apr-15 |

c | 780 | 84.10039 | 8.913545 | 8-Apr-15 |

Accepted Solutions

Solution

05-22-2015
04:15 PM

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

Posted in reply to Rick_SAS

05-22-2015 04:15 PM

Thanks Dr. Rick - Yes, we need one extra set of parentheses to formulate this correctly.

proc sql;

select *,sqrt(sum((count-1)*sigma**2) / **(**sum(count)-count(*))**)** as pool_sigma from have

group by group;

quit;

All Replies

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

Posted in reply to chrisgo

05-21-2015 10:26 PM

Assuming sigma is standard deviation and therefore variance I would look into PROC GLM.

PS. Stats questions are best posted under Statistical Procedure forum.

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

Posted in reply to chrisgo

05-21-2015 10:30 PM

data have;

input Group $ COUNT MEAN SIGMA MEAS_DATE :anydtdte.;

format meas_date ddmmyy8.;

datalines;

a 501 101.1664 12.62792 14-Apr-15

a 123 103.33 10.545 8-Apr-15

b 164 99.21071 16.14705 8-Apr-15

b 697 86.24266 9.794989 9-Apr-15

c 223 82.22 7.422 7-Apr-15

c 780 84.10039 8.913545 8-Apr-15

;

proc sql;

select *,sqrt(sum((count-1)*sigma**2)/sum(count)-count(*)) as pool_sigma from have

group by group;

quit;

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

Posted in reply to stat_sas

05-22-2015 01:43 PM

Are you missing a set of parentheses? Seem like it should be

sqrt(sum((count-1)*sigma**2) / (sum(count)-count(*)))

Solution

05-22-2015
04:15 PM

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

Posted in reply to Rick_SAS

05-22-2015 04:15 PM

Thanks Dr. Rick - Yes, we need one extra set of parentheses to formulate this correctly.

proc sql;

select *,sqrt(sum((count-1)*sigma**2) / **(**sum(count)-count(*))**)** as pool_sigma from have

group by group;

quit;