Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: number of regressors

From   Paul Millar <>
Subject   Re: st: number of regressors
Date   Fri, 18 Mar 2005 22:26:40 -0700

You can do something like this after an estimation command:
di "nvars=" e(df_m)

which is actually printing out the degrees of freedom (doesn't include the constant in OLS)

You can also do the following:
matrix slopes=e(b)
local nvars=colsof(slopes)
di "nvars=`nvars'"

The number of variables will include the constant (for OLS).

The following will give you the variables that are accessible after an estimation command:
ereturn list

- Paul Millar
University of Calgary

At 03:33 PM 18/03/2005, you wrote:

Hi to all,

Could anyone tell me the built-in variable for the number of
regressors in Stata? Thanks!

*   For searches and help try:
*   For searches and help try:

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