comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: Statistics : T-test, P-value

Re: Statistics : T-test, P-value
type: item
description: On Jan 14, 7:20 am, Nick <jungbin...@hotmail.com> wrote: > There are two kinds of data - A group and B group which I have to > analyze. > I came to know these correlation by using 'CORRELATE' function. > However, I want to know whether these correlation is reasonable or > not. > So I want to calculate p-value by T-test. > Is there any idea calculate p-value through t-test through IDL? Try the TM_TEST function. The second value it returns should be your p value. You'll have to figure out which keyword (if any) you need for your particular dataset. Take care, Chris
creator: Spon
date: 2008-01-14T12:18:41-00:00

Re: Statistics : T-test, P-value
type: item
description: >>>> On Jan 14, 7:18 am, Spon <christoph.b...@gmail.com> wrote: >> On Jan 14, 7:20 am, Nick <jungbin...@hotmail.com> wrote: >> There are two kinds of data - A group and B group which I >> have to analyze. >> I came to know these correlation by using 'CORRELATE' >> function. However, I want to know whether these >> correlation is reasonable or not. So I want to calculate >> p-value by T-test. Is there any idea calculate p-value >> through t-test through IDL? > Try the TM_TEST function. The second value it returns > should be your p value. You'll have to figure out which > keyword (if any) you need for your particular dataset. There are many test statistics that are distributed according to the t-distribution, but you must be careful in how you calculate them. IDL's TM_TEST calculates t and the p-value for the Student's t-test, which is useful for testing the hypothesis that two data sets have the same mean. CORRELATE calculates Pearson's correlation coefficient, which follows the t-distribution, but the test statistic is not the same as Student's t. My stats book says that, for Pearson's correlation coefficient, r, the test statistic is r if the number of data points, N, small (N<=150). If N>150, use t = r sqrt((N-2)/(1-r**2)). This follows the t-distribution with N-2 degrees of freedom. You could use IDL's T_PDF function to calculate p-values for that. Nick - Would you post some sample data? Mike
creator: Mike[2]
date: 2008-01-14T14:25:18-00:00

Re: Statistics : T-test, P-value
type: item
description: >> I came to know these correlation by using 'CORRELATE' >> function. However, I want to know whether these >> correlation is reasonable or not. So I want to calculate >> p-value by T-test. Is there any idea calculate p-value >> through t-test through IDL? Hi Nick, I don't know if you can find something useful for you in the following small program: After calculation of the Pearson correlation coefficient with the IDL correlate function, you can test your coefficient in 2 ways: - by computing its CONFIDENCE INTERVAL based on the number of data points. 0 should not be included in this confidence interval to claim that your correlation is significant. - by using a t-test of a null hypothesis on the correlation coefficient ;----------------------------------------------------------- ----------------- ; Significance Tests on Pearson's Correlation ; Based on http://davidmlane.com/hyperstat/B62223.html PRO CORR_TTEST,corr=corr,N=N,sl=sl, ro=ro ; corr: Pearson's correlation coefficient to be tested ; N: Number of samples ; sl: Significance level accepted (ex:0.05,0.001,) ; ro: Correlation value predicted by theory (Null Hypothesis) ; Assumptions ; 1. The N pairs of scores are sampled randomly and independently. ; 2. The distribution of the two variables is bivariate normal. ; NULL hypothesis is ro=ro IF N_Elements(ro) EQ 0 THEN ro=0 IF corr EQ 1.0 THEN corr=0.9999999d ; avoid Floating divide by 0 IF ro EQ 1.0 THEN ro=0.9999999d ; avoid Floating divide by 0 IF corr EQ -1.0 THEN corr=-0.9999999d ; avoid Floating divide by 0 IF ro EQ -1.0 THEN ro=-0.9999999d ; avoid Floating divide by 0 ;----------------------------------------------------------- ----------------- ; COMPUTE CONFIDENCE INTERVAL OF CORRELATION COEFFICIENT ;----------------------------------------------------------- ----------------- ; Conversion of Pearson's correlation to the normally distributed variable zp ; Fisher's transformation zp=0.5*alog((1+corr)/(1-corr)) ;Compute zp standard error sig_zp=1/sqrt(N-3) …
creator: JMB
date: 2008-01-15T11:21:23-00:00