cross id
Posted: Fri May 13, 2011 7:59 am
I will appreciate your help in the following questions:
(1) Is there a function that provide the number of cross-section IDs?
My solution is:
series cxid=@crossid
scalar cxidnum=@max(cxid)
Is there more elegant way?
(2) Is there a function that gives the list of distinct cross-section IDs?
(3) How do I get the value of the cross-section ID for the given sample?
The function @crossid provides a series of numeric values (e.g., like labels), but I would like to know the actual value of the cross-section ID. For example, assume that I restrict the smpl cxid=5, and I would like to record the actual value of cross-section ID.
(4) Is there a function that provides the p-value for LS?
My solution:
@tdist(reg1.@tstats(!i),reg1.@regobs-reg1.@ncoef)
Is there more elegant way?
(5) How can I store and read the value of a group's correlation?
My solution is to save them into a table:
freeze(mode=overwrite, Est_Corr) group1.cor
x=x+Est_Corr(4,2)
I notices that I cannot do something like:
matrix Est_corr=group1.cor
x=x+Est_Corr(2,1)
(6) How do I "next" in the middle of the loop?
Assume I have a "for" loop. Inside the loop, there is an "if" statement that if it true, I would like to move to the next value of the loop. For example:
for !i=1 to 10
if !i=1 then next
!z=!z+!i
next
Of course the "next" in the middle of the loop does not work or does "return". If I use "exitloop", then EViews exits the for statement all together instead of looping to next value of !i. Would would be the command to force the computer to loop to the next value of !i?
(1) Is there a function that provide the number of cross-section IDs?
My solution is:
series cxid=@crossid
scalar cxidnum=@max(cxid)
Is there more elegant way?
(2) Is there a function that gives the list of distinct cross-section IDs?
(3) How do I get the value of the cross-section ID for the given sample?
The function @crossid provides a series of numeric values (e.g., like labels), but I would like to know the actual value of the cross-section ID. For example, assume that I restrict the smpl cxid=5, and I would like to record the actual value of cross-section ID.
(4) Is there a function that provides the p-value for LS?
My solution:
@tdist(reg1.@tstats(!i),reg1.@regobs-reg1.@ncoef)
Is there more elegant way?
(5) How can I store and read the value of a group's correlation?
My solution is to save them into a table:
freeze(mode=overwrite, Est_Corr) group1.cor
x=x+Est_Corr(4,2)
I notices that I cannot do something like:
matrix Est_corr=group1.cor
x=x+Est_Corr(2,1)
(6) How do I "next" in the middle of the loop?
Assume I have a "for" loop. Inside the loop, there is an "if" statement that if it true, I would like to move to the next value of the loop. For example:
for !i=1 to 10
if !i=1 then next
!z=!z+!i
next
Of course the "next" in the middle of the loop does not work or does "return". If I use "exitloop", then EViews exits the for statement all together instead of looping to next value of !i. Would would be the command to force the computer to loop to the next value of !i?