Solved
New Contributor
Posts: 3

# Computing Means Weighted By Sample Size

[ Edited ]

Good afternoon,

I am fairly new to SAS studio and I need a bit of assistance with my data set. In my data set, I am looking to compute the means for prevalence of each parasite that I have (there are seven different parasites) that is weighted by the sample size. In my data set, each study reported certain parasites that were found among their samples. As such, not every study reported each of the seven parasites and a few studies focused on only certain parasites; as such, it is not known if they actually have cases for certain parasites (for example, one study only focused on Giardia--as such, the other six parasites have an unknown prevalence, and was not included in the data set).

Afterwards, I desire to compare the magnitude of the outcomes between groups (groups being the parasites). I am using SAS studio at this time. How would I go about compute the mean of the prevalence for each parasite that I have that is weighted by their respective sample size? I have placed part of the screenshot as an attachment in PDF to give an example of the table that I am working with.

Thank you,

Anthony

Accepted Solutions
Solution
‎07-28-2017 01:53 PM
Super User
Posts: 19,850

## Re: Computing Means Weighted By Sample Size

[ Edited ]

http://blogs.sas.com/content/iml/2016/01/06/weighted-mean-in-sas.html

There's no image or further details

Watkins155 wrote:

Good afternoon,

I am fairly new to SAS studio and I need a bit of assistance with my data set. In my data set, I am looking to compute the means for prevalence of each parasite that I have (there are seven different parasites) that is weighted by the sample size. Afterwards, I desire to compare the magnitude of the outcomes between groups (groups being the parasites). I am using SAS studio at this time.

How would I go about compute the mean of the prevalence for each parasite that I have. Attached below is a screenshot of the data table (partially) that I have showing an example of the data set I'm working with.

Thank you,

Anthony

All Replies
Solution
‎07-28-2017 01:53 PM
Super User
Posts: 19,850

## Re: Computing Means Weighted By Sample Size

[ Edited ]

http://blogs.sas.com/content/iml/2016/01/06/weighted-mean-in-sas.html

There's no image or further details

Watkins155 wrote:

Good afternoon,

I am fairly new to SAS studio and I need a bit of assistance with my data set. In my data set, I am looking to compute the means for prevalence of each parasite that I have (there are seven different parasites) that is weighted by the sample size. Afterwards, I desire to compare the magnitude of the outcomes between groups (groups being the parasites). I am using SAS studio at this time.

How would I go about compute the mean of the prevalence for each parasite that I have. Attached below is a screenshot of the data table (partially) that I have showing an example of the data set I'm working with.

Thank you,

Anthony

New Contributor
Posts: 3

## Re: Computing Means Weighted By Sample Size

My apologies!

I have edited the post with an attachment of the PDF. Furthermore, I have included it below in this reply.

☑ This topic is solved.