Statalist


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

st: R: Create dummy


From   "Carlo Lazzaro" <carlo.lazzaro@tiscalinet.it>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: R: Create dummy
Date   Thu, 20 Nov 2008 09:21:36 +0100

Dear Alexandra,
the following example seems to work:
------------begin example---------------
set obs 10
g quality=0
g response="yes" in 1/5
replace response="no" in 6/10
replace quality = 1 if  response=="no"
------------end example---------------

HTH and Kind Regards,

Carlo
-----Messaggio originale-----
Da: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Per conto di
mmolina@uniroma3.it
Inviato: mercoledì 19 novembre 2008 23.33
A: statalist@hsphsun2.harvard.edu
Oggetto: st: Create dummy

Dear Statlist,
I need to create a dummy from a double variable (sí, no, no sabe)
I wrote:
gen quality = 0
replace quality = 1 if b8=="no"

And I received the message

type mismatch
r(109);

What should I do?

Thanks and regards,
Alejandra Molina



*
*   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/



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