8 Replies Latest reply on Nov 13, 2013 6:06 AM by Robert Hirsch

# How can I analyze a weighted data set, such as one from Pew Internet?

I'm looking to analyze this data set, which is weighted.

April 2012 - Cell Phones | Pew Research Center's Internet & American Life Project

Does anyone know how to take into account the "weight" column when making graphs? I'm very new to Tableau btw

Thanks,

Robert

• ###### 1. Re: How can I analyze a weighted data set, such as one from Pew Internet?

Once you have the data inside Tableau, you can write calculations using the weight field.  That would look something like

[FieldName] * [Weight]

If the weight is only applied under certain conditions, you can evaluate those as well--something like:

IF [Age] > 50 then [FieldName] * [Weight]

else [FieldName]

end

Hope this helps.  If you get that data into Tableau and are trying to set up a view, post a packaged workbook (.twbx file with the data extracted) here on the forum, along with what you are hoping to achieve, and forum members are happy to contribute.

• ###### 2. Re: How can I analyze a weighted data set, such as one from Pew Internet?

Awesome! I'm sure this will be a huge help. I'll post my workbook for sure.

Thanks a lot.

On Tue, Oct 29, 2013 at 10:41 AM, Matthew Lutton <

• ###### 3. Re: How can I analyze a weighted data set, such as one from Pew Internet?

Data set link: Dropbox - cell.twbx

So...I'm trying to create a calculated field using the weighted data column (weight). For a simple example, I'm trying to make a histogram of Q1. The answers to the question are 1,2,3,4,5,8,9.

Making simple histogram works with the unweighted Q1 column.

Now if someone could help me weight this using the "weight" column I'd be very happy

Thanks,

Robert

• ###### 4. Re: Re: How can I analyze a weighted data set, such as one from Pew Internet?

Hi Robert,

To obtain the weighted results for every question we need to create a calculated field (in my solution this new calculated field is called Weighted Number of records) using the formula:

[Number of Records]*[weight]

In this type of analysis we need to determine the frequency of specific responses from every person in the survey. This means that we need to count the number of person (number of records) in every possible response values of a question. As we need the weighted frequencies, we need to calculate number of persons times weight.

See the attached workbook. The dashboard shows Question 1 (q1) results, both unweighted and weighted

I hope this helps,

Best,

Ramon

• ###### 5. Re: Re: How can I analyze a weighted data set, such as one from Pew Internet?

Ok...let's say I wanted to show the relationship between users of specific cell phones (Q15) and their quality of life (Q1). For example: "What percent of each type of cell phone user has each quality of life?" How would I make a stacked bar chart showing that, while calculating in the weight as well?

If any of you genius stats people out there can help me out I'll be so grateful!

I need to perform other calculations like this, so once I know the formula for doing so I can knock this stuff out. Thanks again!!

• ###### 6. Re: Re: Re: How can I analyze a weighted data set, such as one from Pew Internet?

Hi Robert,

Take a look at the attached workbook. See the new worksheets: q15 vs q1 weighted absolute numbers, q15 vs q1 weighted % and stacked bar q15 vs q1

I also recommend you to read the blog post series Visualizing Survey Data by Steve Wexler

I hope this helps,

best,

Ramon

• ###### 7. Re: How can I analyze a weighted data set, such as one from Pew Internet?

HI Robert,

Have you checked the solution to your question in the attached workbook of my last post?

Let me know if you need additional assistance.

Best,

Ramon

• ###### 8. Re: How can I analyze a weighted data set, such as one from Pew Internet?

Ramon,

I haven't had a chance to, but I will be checking it out later tonight. I'll let you know if I have any additional questions. Thank you so much!

Robert

--

Mr. Hirsch

On Wed, Nov 13, 2013 at 7:47 AM, Ramon Martinez