After running a regression model in Stata a quick way to access the coefficients and their standard errors is using _b[varname] and _se[varname]. However, to access their corresponding p-values and confidence interval limits I find myself having to create a matrix of the results from which to extract them, like so:
sysuse auto, clear
regress length weight
mat R = r(table)
local p = R[4,1]
local ll = R[5,1] etc...
The code is rather ugly, having to manually specify the entries of the matrix from which to extract the relevant results. Also, when using multivariable regression I often end up with a sea of numbers from which I need to find my statistics of interest. Clearly this would be much easier (particularly when writing an ado file) if I could instead simply type
local p = _p[weight]
local ll = _ll[weight] etc...
in a similar manner to the _b[] and _se[] functions. My question is therefore, is there an easier way to extract p-values and confidence interval limits to what I have been using, and if not, might Stata consider adding functions like _p, _ll, _ul, _df etc in a future Stata release?
Thanks,
Dan
sysuse auto, clear
regress length weight
mat R = r(table)
local p = R[4,1]
local ll = R[5,1] etc...
The code is rather ugly, having to manually specify the entries of the matrix from which to extract the relevant results. Also, when using multivariable regression I often end up with a sea of numbers from which I need to find my statistics of interest. Clearly this would be much easier (particularly when writing an ado file) if I could instead simply type
local p = _p[weight]
local ll = _ll[weight] etc...
in a similar manner to the _b[] and _se[] functions. My question is therefore, is there an easier way to extract p-values and confidence interval limits to what I have been using, and if not, might Stata consider adding functions like _p, _ll, _ul, _df etc in a future Stata release?
Thanks,
Dan
Comment