Author 
Topic 

zoe2003
Starting Member
15 Posts 
Posted  12/04/2013 : 04:38:44

Hi There,
I need to create a table with Pvalues (from statistical ttest). The table should have the following 3 columns: DF (degree of freedom), X, Pvalue. Pvalue can be calculated in Excel using the following function : T.DIST.RT(X,DF)
Is there a builtin function in PL/SQL to calculate the pvalue ? How can I calculate it without using an Excel ? [It will be a 17M records table 0.00<X<17.00, 1<DF<10000) ]
Tx, Z 

Kristen
Test
United Kingdom
22431 Posts 
Posted  12/04/2013 : 05:09:31

quote: Originally posted by zoe2003
Is there a builtin function in PL/SQL to calculate the pvalue ?
Sounds like you are using Oracle? (This is a Microsoft SQL forum, so doubtful anyone here will now, you'd be better off with an Oracle forum) 


zoe2003
Starting Member
15 Posts 
Posted  12/04/2013 : 06:33:55

I'm using SQL Server 2008 R2 


Kristen
Test
United Kingdom
22431 Posts 
Posted  12/04/2013 : 12:11:26

quote: Originally posted by zoe2003
I'm using SQL Server 2008 R2
OK, well you will be using TSQL then, rather than PL/SQL (which is Oracle's SQL)
Sorry, I don't know anything about statistical functions in SQL, but all functions are listed in "Books Online"  which is the help facility that comes with SQL. It is available on Microsoft's web site, but is also usually installed on your PC / Server when you install SQL Server or the SQL Tools, so you may well find that you have that installed locally (contrary to its, now outdated, name of "Books Online") 
Edited by  Kristen on 12/04/2013 12:12:34 


TG
Flowing Fount of Yak Knowledge
USA
6062 Posts 
Posted  12/04/2013 : 14:04:28

In answer to your question there is no tsql function that will generate PValues.
sql server is not the best application for statistical analysis. but if that is the tool you need to use and you still want a solution from us then you'll likely need to post some better requirements. This site has a lot of sql smarties but probably not many of them are statisticians. From a quick look at some pvalue posts it looks like in order to get an answer you first need to get MEAN values, standard deviations , degree of freedom, and maybe some other stuff too. Not sure if you are asking us to calculate all the prerequisite results or you are providing them.
If you provide sample data and expected output based on the sample data and a description (in nonstatistics speak keeping acronyms to a minimum) about the logic used to get the answer someone can provide a solution.
Look here for how to provide us this information:
by the way, if we can use excel to validate our results that's good but I personally will need more than this to know what i need to put into excel to see actual output: "T.DIST.RT(X,DF)"
Be One with the Optimizer TG 



Topic 
