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]

st: RE: RE: Histogram of a variable after running a regression


From   "Radwin, David" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: Histogram of a variable after running a regression
Date   Mon, 2 Dec 2013 19:03:02 -0500

I should have pointed out that the penultimate line should be 

	histogram `v' if e(sample), name(`v', replace)

if you wish to restrict the histogram to observations in the sample used in the regression (which is probably a good idea).

David
--
David Radwin, Senior Research Associate
Education and Workforce Development
RTI International
2150 Shattuck Ave. Suite 800, Berkeley, CA 94704
Phone: 510-665-8274

www.rti.org/education


> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Radwin, David
> Sent: Monday, December 02, 2013 2:59 PM
> To: [email protected]
> Subject: st: RE: Histogram of a variable after running a regression
> 
> I'm not sure a histogram will give you the information you seek, but here
> is a simple example that yields a histogram for each independent variable.
> 
> 
> sysuse nlsw88
> regress wage age tenure hours
> 
> local names : colnames e(b)
> local x _cons
> local names : list names - x
> 
> foreach v of local names {
> 	histogram `v', name(`v', replace)
> 	}
> 
> 
> David
> --
> David Radwin, Senior Research Associate
> Education and Workforce Development
> RTI International
> 2150 Shattuck Ave. Suite 800, Berkeley, CA 94704
> Phone: 510-665-8274
> 
> www.rti.org/education
> 
> 
> > -----Original Message-----
> > From: [email protected] [mailto:owner-
> > [email protected]] On Behalf Of Ejebu, Ouregazoe
> > Sent: Monday, December 02, 2013 2:23 PM
> > To: [email protected]
> > Subject: st: Histogram of a variable after running a regression
> >
> > Dear Statalist,
> >
> > Please, is it possible to obtain an histogram of my independent
> variables
> > after I have run my regression.
> > For instance if I run y x1 x2...xn
> > I would like to obtain the histogram of x2 to know its percentage in the
> > overall sample.
> >
> >
> > Thank you
> >
> > Kind Regards,
> >
> > Ourega-Zoé Ejebu
> > Business School
> > Room F02
> > Edward Wright Building Annexe
> > Dunbar Street
> > University of Aberdeen

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