Bookmark and Share

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   Joerg Luedicke <[email protected]>
To   [email protected]
Subject   Re: st: st. sampclus
Date   Thu, 10 Mar 2011 16:24:23 -0500

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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index