Page 1 of 1

correlation pvalue and index

Posted: Mon Dec 13, 2010 10:26 am
by Gibus
Hi,
1)How can I get the probability of the correlation coefficient significantly different from 0? I know, this is possible via the command: matrix_name.cor(prob), but how can I get it via a command with 2 series i.e. scalar cor_pvalue =@cor({%Y},{%X})?

2)In a vector V1 (extracted from correlation matrix) containing 5 correlation coefficient from variables (X1,to X5), I would like to identify the variable with a highest correlation coefficient.
How can I get the name of the variable? %selected_variable = @cimax(V1)?

Thanks

Re: correlation pvalue and index

Posted: Mon Dec 13, 2010 10:47 am
by EViews Gareth
1) Put the series into a group then use group.cor(prob)

2) Hard to say without seeing the rest of your code. But assuming you have (or can put) the names in a string somewhere:

Code: Select all

%names = "x1 x2 x3 x4 x5" !imax = @cimax(v1) %selected_variable = @word(%name, !imax)

Re: correlation pvalue and index

Posted: Tue Dec 14, 2010 3:03 am
by Gibus
!kmax = @cimax(Vcor) leads to "Error assigend to scalar", Why?
I think perhaps better to sort the vector by descending order and to select the second line V1(2).
By the way how can I constraint te command "@cimax" e.g. !kmax = @cimax(Vcor) <>1, i.e.select max from the vector different to "1"?

correlation pvalue and index

Posted: Tue Dec 14, 2010 7:51 am
by EViews Gareth
You cannot.