*! version 1.0 2/21/2018

Title

intspec -- Define interaction specification for ICALC add-on prior to using gfi, sigreg, effdisp or outdisp commands

Description

intspec Specifies interacting variables, their display ranges and names, which variable to treat as focal
and which varible(s) to treat as moderating. Can set equation name of results to use if there are multiple. See Kaufman (2018)
for detailed explanation and step-by-step examples of using this and other ICALC add-on commands.

Syntax

intspec focal(varname) main((varlist1, suboptions)(varlist2, suboptions) … )
int2vars(varlist) [ int3vars(varlist) dvname(string) eqname(string) ndigits(#)
nrange(#) abbrevn(#) sumwgt(string) ]

options Description

focal(varname) specifies the name of the focal variable

main((varlist, suboptions) ... ) sets info for each focal and moderator main effect variable

varlist varname if interval variable

fvname if factor variable

varlist if a set of dummy variables

Relative order determines moderator numbering; moderator#1 is 1st moderator listed; moderator#2 is 2nd moderator listed; focal set can be in any order

suboptions name(string) display name for the variable; default is 1st varname in varlist , abbreviated to 12 characters

range(numlist)numlist sets display values to label/define tables and graphs for interval variable.
Max # of digits in numlist entry defines # digits for display values. OR

range(keyword) keyword can be

minmax min to max in increments = (max-min)/nrange

meanpm1 mean +/- 1 std. dev.

meanpm2 mean +/- 1 std. dev., +/- 2 std. dev.

meanpm1mm min, mean +/- 1 std. dev., max

meanpm2mm min, mean +/- 1 std. dev. And +/- 2 std. dev., max

Default is range(minmax) with default nrange=5. For a single dummy variable can specify range(0/1)
Not needed for i.varname; ignored if included

int2vars(varlist) lists the 2-way interaction terms; must be ordered as focal-by-moderator#1 focal-by-moderator#2 ; if a 3-way interaction also moderator#1-by-moderator#2

int3vars(varlist) lists the 3-way interaction terms if any; must be ordered as focal-by-moderator#1-by-moderator#2

dvname(string) display name of dependent variable. Default is varname of dependent variable.

eqname(string) use for multi-equation models; string specifies which equation’s coefficients are analyzed

ndigits(#) integer # of digits used in default display value labels if range( ) not specified. Default ndig(2)

nrange(#) nrange+1 = # of increments in range(minmax); Default is 5 increments

abbrevn(#) specifies the character length used to abbreviate names; must be an integer; default is abbrevn(12)

sumwgt(string) sumwgt(no) specifies that estimation command weights not used to calculate summary statistics

Example 1: two-way interaction

After a model predicting poor mental health days (pmhdays) which includes the interaction of work-family conflict (wfconflict) and job status (sei), intspec
specfies wfconflict) as the focal and sei as the moderating variable and identifies c.wfconflict#c.sei as the term
used to model the interaction of wfconflict) and sei.

*** Interaction specified using factor variables, use default display names and ranges

nbreg pmhdays c.wfconflict##c.sei ...

intspec focal(c.wfconlifct) main( (c.sei) (c.wfconflict)) int2vars(c.wfconflict#c.sei)

*** Also specify display names and ranges

intspec focal(c.wfconlifct) main( (c.sei, name(JobStatus) range(17(10)97)) (c.wfconflict, name(WorkFamConflict) range(1/4))) int2vars(c.wfconflict#c.sei)

*** Not using factor variables, use product term wfconbysei (=wfconflict*sei), use default display names and ranges

nbreg pmhdays wfconflict sei wfconfbysei ...

intspec focal(wfconlifct) main( (sei) (wfconflict)) int2vars(wfconbysei)

Example 2: three-way interaction

After a model predicting voluntary association memberships (memnum) which includes the interaction of age, educ (education) and female, intspec
specfies the focal and moderating variables, their names and ranges, and the model terms for the interactions

*** Interaction specified using factor variables, specify display names and ranges, set numeric display labels' format to 2 digits

reg memnum i.female##c.age##c.educ ...

intspec focal(i.female) main( (c.age, name(Age) range(18(10)88)) (c.educ, name(Education) range(0(4)20)) (i.female, name(Sex) range(0/1)) )
int2vars( c.age#i.female c.ed#i.female c.age#c.ed ) int3vars(i.female#c.age#c.ed) dvname(Memberships) ndig(0)

Author and Citation

I would appreciate users of this and other ICALC commands citing

Robert L. Kaufman. 2018. Interaction Effects in Linear and Generalized Linear Models, Sage Publcations.