BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
chrisgo
Calcite | Level 5

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

GroupCOUNTMEANSIGMAMEAS_DATE
a501101.166412.6279214-Apr-15
a123103.3310.5458-Apr-15
b16499.2107116.147058-Apr-15
b69786.242669.7949899-Apr-15
c22382.227.4227-Apr-15
c78084.100398.9135458-Apr-15
1 ACCEPTED SOLUTION

Accepted Solutions
stat_sas
Ammonite | Level 13

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;

View solution in original post

4 REPLIES 4
Reeza
Super User

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

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

stat_sas
Ammonite | Level 13

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;

Rick_SAS
SAS Super FREQ

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

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

Pooled variance - Wikipedia, the free encyclopedia

stat_sas
Ammonite | Level 13

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;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1674 views
  • 0 likes
  • 4 in conversation