testbeta(Term, hypValue [,df:T] [,pval:T]), Term a quoted or unquoted variable name or an integer term number, hypValue a non-MISSING real scalar |

You can use testbeta() to compute a t-statistic to test a null hypothesis of the form H0: betaj = hypValue, where betaj is a regression coefficient. There must be an active regression model, that is you need to have executed a command of the form regress("y = x" or regress("y=x1 + x2 + ... xk"). testbeta(Term, betaj0), where Term is the quoted or unquoted name of a predictor in the regression (for example, "x3" or x3) and betaj0 is a REAL scalar whose value is the hypothesized value of the regression coefficient of the predictor. Term can also be the number of the term associated with the variable in an ANOVA. The value is the test statistic Tstat = (betajHat-betaj0)/SE[betajHat]. testbeta(Term, betaj0, pvalue:T) does the same except the value returned is structure(tstat:Tstat, pvalue:Pvalue), where Pvalue is the two-tail P-Value associated with Tstat. testbeta(Term, betaj0, df:Df [, pvalue:T]), returns structure(tstat:Tstat, df:Df [,pvalue:Pvalue]), where Df = error degrees of freedom. Example: Cmd> regress("y = x", silent:T) # output suppressed Cmd> testbeta(x, 1, pvalue:T, df:T) # tests H0: beta = 1 See also secoefs(), twotailt().

Gary Oehlert 2003-01-15