10 Replies Latest reply on Jul 13, 2012 3:05 PM by rochelle.sun

# T-Test calculation

Greetings,

Has anybody here figured out / posted a table calculations that will perform a t-test for significance?

For my purposes I have a percentage of people that answered "yes" to a question in one quarter, and then another percentage that answered "yes" to the same question in the following quarter.  The T-Test calculation the number of survey participants for each quarter as the number will not be the same.

I have a simple Excel spreadsheet that shows how to fashion the calculation.

I have not spent any time (yet) creating a custom table calc with the hope that somebody here has already figured it out.

Thanks much.

Steve Wexler

• ###### 1. Re: T-Test calculation

best to provide details on the calculation you want to perform.

From looking at http://www.socialresearchmethods.net/kb/stat_t.php I am not sure how the t-test concept described there fits with your description.

If you can provide your logic, and sample data, a calculated field can be provided.

• ###### 2. Re: T-Test calculation

I also found http://www.jerrydallal.com/LHSP/psd.htm and with both those references, I was able to make the attached.

Is this what you are looking for?

• ###### 3. Re: T-Test calculation

Joe,

I had a feeling either you or Andy would pipe in on this quickly.

A colleague gave me a simple spreadsheet that shows how in Excel to compute the T-Test.  To be honest, I'm not sure if it is correct but if it is then your approach needs a couple of modifications.

Have a look at the attachment (cells A1 and B1 contain the response counts).

Thanks.

Steve

• ###### 4. Re: T-Test calculation

after a little bit of searching, I think what you are looking for is called the two-proportion z-test (at least the Excel formula used matches the results).

I did the calculation two ways in the workbook, one calc field for each concept, and another as a single calc.

• ###### 5. Re: T-Test calculation

Joe,

I forgot to mention how much I like the sum(1) trick.  I had been using countd(ID), but really like the simplicity of sum(1).

This looks right to me, but I need to find out if this is what is wanted or the t-test (this is not my area of expertise, but a great opportunity to learn new stuff.)

Also, you are correct that the values should be negative.

Very cool (and thanks for doing both the single and dual calc versions).

Steve

• ###### 6. Re: T-Test calculation

SUM(1) is the same thing as SUM([Number of Records]), it feels like less typing/clicking for me, just a personal preference.

Whereas COUNTD([ID]) is not always the same as SUM(1), but I can imagine situations where they would be the same, it depends on your data and situation.

Here is the reference that I used, they provide some sample situations/questions as well:

http://stattrek.com/AP-Statistics-4/Test-Difference-Proportion.aspx?Tutorial=AP

• ###### 7. Re: T-Test calculation

Joe,

Got you on the SUM(1) thing.

Steve

• ###### 8. Re: T-Test calculation

Hello Joe.

I have a similiar question about T-test for "mean", rather than proportional.

Do you know how to create same calculation in Tableau for the excel function T.Dist.2T(% lift from mean of treatment group vs. mean of control group, degree of freedom)?

Thanks.

Rochelle

• ###### 9. Re: T-Test calculation

Rochelle,

Can you please provide a sample Excel file that performs the calculation you are looking for?

Also I recommend starting a new thread

• ###### 10. Re: T-Test calculation

Hi Joe.

I attached an excel file with sample calculation in my post above. Basically I need a similiar calculation in Tableau to achieve the T.DIST() function in excel to get p-value of a T-test.

I will start a new thread too.

Please let me know if you have any insights. Thanks!

Rochelle