.- Help for ^desmat^, ^desrep^, ^tstall^ [STB-52: sbe31] .- Using categorical variables in Stata ------------------------------------- ^desmat^ model [, default_parameterization] ^desrep^ [^exp^] ^tstall^ [^equal^] Description ------------ ^desmat^ is used to generate a design matrix, i.e. a set of dummy variables based on categorical and/or continuous variables. These dummy variables _x_* can then be used in any appropriate Stata procedure. ^desmat^ therefore serves the same purpose as ^xi^, but allows different types of parameterizations than the indicator contrast (i.e. dummy variables with a fixed reference category). In addition, ^desmat^ allows the specification of higher order interaction effects and an easier specification of the reference category. ^desrep^ can be used after estimating a model, to produce a compact overview of the estimates with informative labels. ^tstall^ can be used to perform a Wald test on all terms in the model. Choices for default parameterization ------------------------------------ ^dev(^ref^)^ indicates the deviation contrast. Parameters sum to zero over the categories of the variable. The parameter for ref is omitted as redundant, but can be found from minus the sum of the estimated parameters. ^ind(^ref^)^ indicates the indicator contrast, that is, dummy variables with ref as the reference category. This is the parameterization used by ^xi^ and the default parameterization for ^desmat^. ^sim(^ref^)^ indicates the simple contrast with ref as reference category. The highest order effects are the same as indicator contrast effects, but lower order effects and the constant will be different. ^dif(^ref^)^ indicates the difference contrast, for ordered categories. Parameters are relative to the previous category. If the first letter of ref is ^b^, then the backward difference contrast is used instead, and parameters are relative to the previous category. ^hel(^ref^)^ indicates the Helmert contrast, for ordered categories. Estimates represent the contrast between that category and the mean value for the remaining categories. If the first letter of ref is ^b^, then the reverse Helmert contrast is used instead, and parameters are relative to the mean value of the preceding categories. ^orp(^ref^)^ indicates orthogonal polynomials of degree ref. The first dummy models a linear effect, the second a quadratic, etc. This option calls ^orthpoly^ to generate the design (sub)matrix. ^use(^ref^)^ indicates a user-defined contrast. ref refers to a contrast matrix with the same number of columns as the variable has categories, and at least one fewer rows. If row names are specified for this matrix, these names will be used as variable labels for the resulting dummy variables. (Single lowercase letters as names for the contrast matrix cause problems at the moment; for example, ^use(^c^)^. Use uppercase names or more than one letter, for example, ^use(^cc^)^ or ^use(^C^)^.) ^dir^ indicates a direct effect, used to include continuous variables in the model. Optional argument for ^desrep^ ------------------------------- ^desrep^ is usually used without any arguments. If ^e(b)^ and ^e(V)^ are present, it will produce a summary of the results. If the argument for ^desrep^ is ^exp^ it will produce multiplicative parameters, e.g., incident-rate ratios in Poisson regression, and odds ratios in logistic regression. The parameters are transformed into ^exp(b)^ and their standard errors into ^exp(b)*se^, where ^b^ is the linear estimate and ^se^ its standard error. Optional argument for ^tstall^ ------------------------------- The optional argument ^equal^, if used, is passed on to ^testparm^ as an option to test for equality of all parameters in a term. The default is to test whether all parameters in a term are zero. Author ------ John Hendrickx University of Nijmegen, Netherlands j.hendrickx@@mailbox.kun.nl