SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 P-Value in SQL
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

zoe2003
Starting Member

15 Posts

Posted - 12/04/2013 :  04:38:44  Show Profile  Reply with Quote
Hi There,

I need to create a table with P-values (from statistical t-test).
The table should have the following 3 columns: DF (degree of freedom), X, P-value.
P-value can be calculated in Excel using the following function :
T.DIST.RT(X,DF)

Is there a built-in function in PL/SQL to calculate the p-value ?
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
22415 Posts

Posted - 12/04/2013 :  05:09:31  Show Profile  Reply with Quote
quote:
Originally posted by zoe2003

Is there a built-in function in PL/SQL to calculate the p-value ?


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)
Go to Top of Page

zoe2003
Starting Member

15 Posts

Posted - 12/04/2013 :  06:33:55  Show Profile  Reply with Quote
I'm using SQL Server 2008 R2
Go to Top of Page

Kristen
Test

United Kingdom
22415 Posts

Posted - 12/04/2013 :  12:11:26  Show Profile  Reply with Quote
quote:
Originally posted by zoe2003

I'm using SQL Server 2008 R2



OK, well you will be using T-SQL 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
Go to Top of Page

TG
Flowing Fount of Yak Knowledge

USA
6062 Posts

Posted - 12/04/2013 :  14:04:28  Show Profile  Reply with Quote
In answer to your question there is no t-sql function that will generate P-Values.

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 p-value 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 non-statistics 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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000