Hi everybody!
I use Eviews 7. I would like to delete some rows from a matrix. To be more specific I would like to delete a row if the number of zero elements in the row is more than 90% of the number of elements in the row. In other words if zero elements are more than a specific number. It seems an easy problem but I am confused with the programming language and yet I don't know if it is possible to delete rows from a matrix. I tried to delete the rows manually from a group that has the same dimensions and elements with the matrix but it kept the date on the left (it warned that it was going to do so anyway).
Regards,
Iris
delete rows from matrix
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: delete rows from matrix
Before discussing the programming question it might be useful if you describe what it is you are trying to do. "Deleting" rows from a matrix isn't easy, but I bet an operation that more readily gets you to where you want to go.
Re: delete rows from matrix
Thank you for your reply!
I'll try to describe what I am trying to do as precisely as I can.
I have a matrix(3830,74). Some of its rows contain zeros. The maximum number of zeros is 74 for some rows.
I know because I converted the matrix to a group and then used the the @rvalcount(group,0) function to count the zeros in each row.
I want to find the rows that contain more than 90%*74 zeros and delete them.
I'll try to describe what I am trying to do as precisely as I can.
I have a matrix(3830,74). Some of its rows contain zeros. The maximum number of zeros is 74 for some rows.
I know because I converted the matrix to a group and then used the the @rvalcount(group,0) function to count the zeros in each row.
I want to find the rows that contain more than 90%*74 zeros and delete them.
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: delete rows from matrix
What I wanted to know is what you want to do with the matrix when you are done as there may be other ways of representing the data. But beyond that, since you've already converted the matrix to a group, why not set the sample to exclude obs using the @rvalcount and then convert back to a matrix.
Re: delete rows from matrix
I would use that matrix to run another program. Yes, you' re right!
Thank you very much for your help!
Thank you very much for your help!
Who is online
Users browsing this forum: No registered users and 2 guests
