Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: st. sampclus
From 
 
César Mora <[email protected]> 
To 
 
<[email protected]> 
Subject 
 
Re: st: st. sampclus 
Date 
 
Thu, 10 Mar 2011 19:37:05 -0500 
Don't worry
Thank you very much,  I  resolved my problem yet!!
----- Original Message ----- 
From: "Joerg Luedicke" <[email protected]>
To: <[email protected]>
Sent: Thursday, March 10, 2011 4:24 PM
Subject: Re: st: st. sampclus
On Thu, Mar 10, 2011 at 3:05 PM, César Mora <[email protected]> wrote:
* I want to know, how to capture n1(corrected) in scalar. In other words I
want to know the equivalent commad "scalar name=r(N_1)" for sampclus.
sampclus is not returning anything. If you really need this
information as a scalar you could tune the sampclus ado file. Only 2
little changes would be needed:
1) In the program define line at the beginning, rclass should be
added, so instead of
program define sampclus
it should look like this:
program define sampclus, rclass
2) At the very end of the program you can insert the following right
before the end statement:
return scalar N_2 = `newn2'
return scalar N_1 = `newn1'
so the end of the program should look like this:
return scalar N_2 = `newn2'
return scalar N_1 = `newn1'
end
When you save the program and run it again, type -return list-. Now
you can capture the desired information.
hth
J.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/ 
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/