correlation pvalue and index

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

Gibus
Posts: 9
Joined: Tue Dec 07, 2010 2:57 am

correlation pvalue and index

Postby Gibus » Mon Dec 13, 2010 10:26 am

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: correlation pvalue and index

Postby EViews Gareth » Mon Dec 13, 2010 10:47 am

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)

Gibus
Posts: 9
Joined: Tue Dec 07, 2010 2:57 am

Re: correlation pvalue and index

Postby Gibus » Tue Dec 14, 2010 3:03 am

!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"?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

correlation pvalue and index

Postby EViews Gareth » Tue Dec 14, 2010 7:51 am

You cannot.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests