Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: svy: total command


From   Steve Samuels <sjsamuels@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: svy: total command
Date   Mon, 19 Nov 2012 21:00:16 -0600

There's no such thing in Stata as a "label variable". I'm guessing that
you refer to a variable with values 1 = "Yes" 2 = "No". that has been
assigned a "value label" the name of which you can find with "des
q518_1" In that case, -total dremit1- is correct. If there are other
numbered responses that you con't want to count as "No", (e.g. 8=
"Refused", 9="Not Applicable"), you might have to restrict to "Yes" and
"No", e.g.

************************ 
svy, subpop(if inlist(q518_1,1,2) over(internal): total dremit1
 ************************

But _if_ q518_1 is coded just as "internal" is coded, then 
generating  dremit1 was unnecessary.


When you joined Statalist you you received a welcome email that stated:
"Please read that FAQ at your convenience, but certainly before you post
anything to the list."

I would not have guess what your variables are if you had followed
Statalist FAQ Section 3.3, first sentence: "Say exactly what you typed
and exactly what Stata typed (or did) in response. N.B. exactly!".
If you had yourself compared the results of the two -total- statements,
the answer to your question might have been obvious, making a post
unnecessary.

Steve


On Nov 19, 2012, at 5:49 AM, Rebecca Pietrelli wrote:

Dear all,

I am using the Stata command svy: total, in order to estimate the
total number of migrants from Uganda, residing within or outside
Uganda, who remit money to their origin family.


The specific command I am using is:

. tab q518_1, gen(dremit)

(the answer to the question 5.18_1 is a label variable: yes if the
migrant remits and no otherwhise)

. svy, over(internal): total dremit1

(internal = 1 if the migrant has migrated within Uganda and 0 otherwhise).


Is this procedure correct?
Or should I use total command directly on label variable q518_1?

thank you
Rebecca
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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