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: How to subdivide a variable


From   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: How to subdivide a variable
Date   Tue, 10 Sep 2013 11:29:38 +0200

Say your model is a linear regression with variables y x1 and x2, then
you would type:

reg y x1 x2 if inrange(income,10000, 20000)

or

reg y x1 x2 if income >=10000 & income <= 20000

I tend to make less mistakes with the first method, so I prefer that one.

hope this helps,
Maarten


On Tue, Sep 10, 2013 at 10:37 AM, Asad Mushtaq <[email protected]> wrote:
> Hi all,
> hope you all are fine. I have a variable named income. its minimum
> value is 10k and maximum 100k. now i want to subdivide this income
> variable so that inc1 = 10k-20k, inc2=20k-40k, inc3=40-70k and
> inc4=>70k.  when i use egen command (egen incomecut=(cut income) at
> (20,40,70) etc, though it divide the variable, but i dont know how to
> use only a specific range to use in regression. for example what
> should i do if i want to check the effect of only income range 10k-20k
> in my model. Thanks
> *
> *   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/



-- 
---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany

http://www.maartenbuis.nl
---------------------------------
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index