1. Home
  2. RKESTIMATES directive

RKESTIMATES directive

Saves estimates and other information about individual terms in a regression analysis.

Options

FACTORIAL = scalar Limit on number of factors and variates in a model term; default 3
Y = variate Response variate for which results are to be saved; default is the last response variate in the save structure
SAVE = identifier Provides the regression save structure for the analysis from which the estimates are to be saved; default * takes the save structure from the most recent regression

Parameters

TERMS = formula Model terms for which information is required
ESTIMATES = tables or scalars Table or scalar to store the estimated regression coefficients for each term
SE = tables or scalars Table or scalar to store the standard errors of the estimated regression coefficients
VCOVARIANCE = symmetric matrices Table or scalar to store the variances and covariances between the estimates of each term
DF = scalars Number of degrees of freedom for each term
POSITIONS = tables or scalars Positions of the estimates in the variate of estimates as saved from RKEEP when option EXPAND=yes

Description

RKESTIMATES allows you to save estimates and other information about terms in a regression or generalized linear model analysis into Genstat data structures. You do not need to declare the structures in advance; Genstat will declare them automatically to be of the correct type and size.

By default the results are saved from the most recent analysis, that is for the last y-variate in the most recent MODEL statement. Alternatively, you can use the SAVE option to specify the save structure from another analysis (see the SAVE option of MODEL). Again, the default is to save the information for the last y-variate, but you can use the Y option to specify another one.

The TERMS parameter specifies a model formula, which Genstat expands to form the series of model terms about which you wish to save information. As in FIT, the FACTORIAL option sets a limit on the number of factors and variates in each term. Any term containing more than that limit is deleted. You can include the single-line text 'constant' (in any case) to refer to the constant term. The subsequent parameters allow you to specify identifiers of data structures to store the various types of information for each of the terms that you have specified. The ESTIMATES parameter saves estimates for each term, in a table if the term involves factors or in a scalar if it involves only variates. Similarly the SE parameter saves standard errors for the estimates. The VCOVARIANCE parameter saves the variances and covariances between the estimates of each term, in a symmetric matrix if the term involves factors or in a scalar if it involves only variates. The DF parameter saves the number of degrees of freedom for the terms, in scalars. Finally, the POSITIONS parameter saves the positions where the estimates can be found in the variate of estimates that would be saved by the ESTIMATES parameter of RKEEP when its option EXPAND=yes. (This allows you, for example, to obtain correlations between the estimates of different terms out of the variance-covariance matrix that can be saved by the VCOVARIANCE parameter of RKEEP.)

Options: FACTORIAL, Y, SAVE.

Parameters: TERMS, ESTIMATES, SE, VCOVARIANCE, DF, POSITIONS.

See also

Directives: FIT, FITCURVE, FITNONLINEAR, RKEEP.

Commands for: Regression analysis.

Example

" Examples 2:3.2, 2:3.2.1-6, 2:3.2.7a-b, 2:3.2.8 "
"  Multiple linear regression of the heat given out by setting cement
   on four chemical constituents. Data from Woods, Steinour & Starke
   (1932); analysed by Draper & Smith (1981) p.629."
OPEN '%GENDIR%/Examples/GuidePart2/Cement.dat'; CHANNEL=2
READ [PRINT=data; CHANNEL=2] X[3,1,4,2],%gypsum,Heat
" Analyse only those samples with 3.2% gypsum."
RESTRICT Heat; %gypsum==3.2
MODEL Heat
" Constituents are: X[1]  tricalcium aluminate
                    X[2]  tricalcium silicate
                    X[3]  tetracalcium aluminoferrite
                    X[4]  beta-dicalcium silicate "
FIT [FPROBABILITY=yes; TPROBABILITY=yes] X[]
RDISPLAY [PRINT=accumulated; FPROBABILITY=yes]
RKESTIMATES X[]; ESTIMATES=Est[1...4]; SE=se[1...4]
PRINT Est[1],se[1],Est[2],se[2],Est[3],se[3],Est[4],se[4]; FIELD=10,8
TERMS [PRINT=correlation] X[]
ADD [PRINT=deviance,estimates; TPROBABILITY=yes] X[1,2,4]
DROP [PRINT=deviance,estimates; TPROBABILITY=yes] X[4]
SWITCH [PRINT=estimates,accumulated; FPROBABILITY=yes;\
       TPROBABILITY=yes] X[2,4]
TRY X[2,3]
FIT [FPROBABILITY=yes; TPROBABILITY=yes] X[]
RWALD
FIT [PRINT=*] X[1]
STEP [INRATIO=4; OUTRATIO=4; FPROBABILITY=yes; TPROBABILITY=yes] X[1...4]
TERMS X[]
STEP [PRINT=changes; INRATIO=4; OUTRATIO=4; MAXCYCLE=10] X[]
RDISPLAY [FPROBABILITY=yes; TPROBABILITY=yes]
RSEARCH [METHOD=allpossible] X[1...4]
CLOSE 2
Updated on October 28, 2020

Was this article helpful?