
1. Re: How do I perform a ttest using R?
jordan.bunker Mar 26, 2014 10:04 AM (in response to Chris Dunham)Hi Chris,
Since SCRIPT functions are table calculations, all measures within the formula must be passed as aggregates. If the calculation is occurring at the rowlevel of the data, you can use ATTR() to aggregate the measure for the purposes of the calculation.
Hope that helps! Would love to hear back!
 Jordan

2. Re: How do I perform a ttest using R?
Chris Dunham Mar 26, 2014 11:03 AM (in response to jordan.bunker)Jordan,
Thank you for the answer. I am having a hard time figuring out what I need to do here. As I understand it, there is no way to perform this type of test as R does it  by taking in 2 vectors, calculating a mean, standard deviation, etc., then producing a pvalue.
Would I have to calculate the various inputs above in Tableau and create a custom function in R to give the pvalue? (this is more complex than I'd like this process to be). The issue with trying to do everything in Tableau is that it's not possible to reference a tdistribution, as you can in Excel with TINV(confidence level, degrees of freedom) to attain a critical value for comparison.
If there is some workaround in Tableau to pass a vector into R, I would love to learn the trick.
Thanks,
Chris 
3. Re: How do I perform a ttest using R?
jordan.bunker Mar 26, 2014 11:25 AM (in response to Chris Dunham)Hey Chris,
To be very honest, I'm not very familiar with R, and my stats knowledge is limited, however the following blog post by Bora Beran contains a workbook that demonstrates using R to perform a ttest and calculate an R value:
Statistical testing in Tableau with R « Bora Beran
Downloading the workbook and playing with it might get you started in the right direction. Good luck!
 Jordan