Stata FAQ
How do I use xi3?
The xi3 program is an extension of xi. Let's begin with the
xi3.ado program. You can install xi3 over the internet by typing findit
xi3 (see How can I use the findit command to search for programs and get additional
help? for more information about using findit).
The xi3 command is the same as the xi command, except that it allows 3 way
interactions, any combination of continuous and categorical variables, and
performs additional coding schemes beyond indicator coding, and can create
coding schemes that allow for testing simple contrasts and simple effects. The syntax of xi3 is much like the
syntax of xi as shown below.
xi3 [, prefix(string)] term(s)
xi3 [, prefix(string)] : any_stata_command varlist_with_terms ...
where a term is a mixture of continuous (Con) and categorical (Cat)
variables of the form:
Main Effects
Con: varname
Cat: prefix.varname
Two Way Interactions
Cat by Cat: prefix.varname1*prefix.varname2
Cat by Con: prefix.varname1*varname2
Con by Cat: varname1*prefix.varname2
Con by Con: varname1*varname2
Three Way Interactions
Cat by Cat by Cat: prefix.varname1*prefix.varname2*prefix.varname3
Cat by Cat by Con: prefix.varname1*prefix.varname2*varname3
..
Con by Con by Con: varname1*varname2*varname3
and you can also request simple effects for two way interactions using the @
operator
Cat by Cat: prefix.varname1@prefix.varname2
Con by Cat: varname1@prefix.varname2
Additional Coding Schemes
The xi3 command allows additional prefixes beyond i.varname. These prefixes
create a number of additional coding schemes, as described below.
i.varname - Indicator (dummy) coding: compares each level to the omitted group
c.varname - Centered indicator (dummy) coding
s.varname - Simple coding: compares each level to a reference level
d.varname - Deviation coding: deviations from the grand mean
h.varname - Helmert coding: compares levels of a variable with the mean of
subsequent levels
r.varname - Reverse Helmert coding, compares levels of a variable with the mean
of previous levels
f.varname - Forward differences: adjacent levels, each vs. next
b.varname - Backward differences: adjacent levels, each vs. previous
o.varname - Orthogonal polynomial contrasts
u.varname - User defined coding scheme
For more information on the usage of xi3 see the help file by typing
help xi3
Also, you can see
for more information on the use of xi3. Although some of these chapters
use xi2, all of the features of xi2 are present in xi3.
UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services
The content of this web site should not be
construed as an endorsement of any particular web site, book, or software
product by the University of California.