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
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: st. sampclus
Date
Fri, 11 Mar 2011 00:44:14 +0000
Joerg is right. But if you follow his advice, you just changed Joanne
Garrett's program. So, make sure you keep that change private and take
responsibility for how it now behaves.
Nick
On Thu, Mar 10, 2011 at 9:24 PM, Joerg Luedicke
<[email protected]> wrote:
> 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.
*
* 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/