[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: RE: help margin- beginnerīs ask (again!)
I'm not clear what is unclear here.
But coding depends on how your variable is coded
at present. Suppose you are currently
coding -myvar- with values with 1 and 2.
. gen dummy = myvar - 1
will convert it to 0/1 form.
Suppose you are coding -sex- with string
values "male" and "female".
. gen gender = sex == "female"
will map "female" to 1 and "male" to 0
(and also any missings etc. to 0), so that
. gen gender = 1 if sex == "female"
. replace gender = 0 if sex == "male"
may be safer. Follow by
. count if missing(gender)
This may help on binaries (true and false, etc.):
> In the help file of margin, the author says to code the
> dummy variable as 0/1. How can I do that?
* For searches and help try: