hey there,
i'm trying to program non-parametric tests whether a certain set of observations is significantly different from zero.
in order to program the simple sign test and wilcoxon and corrado rank sign tests, i need to solve the following issue:
suppose i have the following series grouped (in reality they're many more):
rs1 rs2 rs3 rs4
+1 -2 +2 +3
-2 -3 -1 -1
+2 +4 -1 -2
...
can anybody think of a way to count the number of positive items in a row?
what i need to have is a series containing these numbers (concerning all the series in the group) which would look like this for my example:
pos
3
0
2
...
thankful for any advice!
count positive group items
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: count positive group items
The only way I can think is to create a new group with a @recoded version of each series and they count the number of observations in each row. You can do this in a small program without too much effort. Suppose group GRP1 has your series and that there is no group GRP2 in the workfile...
Here, we create a copy of the original group with new series that are based on the old, but with NAs whenever the series value is non-positive. Then we count the number of valid observations.
Code: Select all
group grp2
for !i=1 to group01.@count
%name = group01.@seriesname(!i)
grp2.add @recode({%name}>0, {%name}, na)
next
series numpos = @robs(grp2)
delete grp2Re: count positive group items
hey glenn! marvelous, that worked very well...so i'm done with programming all statistical tests i need thanks to you guys' help!
thanks a lot!!!!! :)
thanks a lot!!!!! :)
Who is online
Users browsing this forum: No registered users and 2 guests
