Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: matrix size and ranking values


From   "NEYMOTIN, FLORENCE" <neymotin@calmail.berkeley.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: matrix size and ranking values
Date   Tue, 28 Jun 2005 12:46:25 -0700

I can't change the data because I ALREADY DID a preserve, so I want to get the original data back ONLY AT THE VERY END and I don't want to do another preserve before that. I am writing this to be compatible with stata7 so matsize 800 is a binding constraint. Thank you for the suggestions!!
florence


On Tue, 28 Jun 2005 20:41:54 +0100
"Nick Cox" <n.j.cox@durham.ac.uk> wrote:

set obs 1000 gen value = .
qui forval i = 1/1000 { replace value = x`i'[1,1] in `i' }
sort value l if inlist(_n,50,950)
Nick n.j.cox@durham.ac.uk
P.S. matsize 800 is not a limit in all versions
of Stata.
P.P.S. your comment about not being able to change the data is not convincing: as you know about -restore-, you can get round any restriction.
NEYMOTIN, FLORENCE


If I have 1000 vectors (nx1 matrices) and I would like to compare the first value in each vector in order to find the 50th largest, and the 950th largest of these values, is there an easy way to do this in stata? I know I can't have more than 800 entries in any one vector, so I'm not able to simply create a vector that contains within it the first value in each of the original 1000 vectors. I am also NOT able to change the data because it is already in a mode that needs to be put into restore later. Is there an easy algorithm anyone can think of to do this?
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index