## Frequently asked question about my macros

(also see the FAQ page for PROCESS)

First, some general guidance and rules:

(1) Read the article corresponding to the macro before you attempt to use it. I also recommend you download and also

(2) Download and run the macro definition command set (the .sps file or .sas file) EXACTLY AS IS from the web page.

(3) All macros produce an SPSS or SAS command defined by the macro name. It is through this command that you get the macro to work. The syntax structure for the macro can be found in the documentation or, in some cases, in the published article that describes the macro’s functionality. For lessons on how to run SPSS commands through the syntax system, consult the SPSS help files or an SPSS manual.

(4) You do not need to run the macro command definition set more than once. Although there is no harm in doing so, the second time you do, you will get a WARNING message from SPSS saying something like

>Warning # 6804 in column 3.

>The macro name specified on the DEFINE command duplicates the

>name of a previously defined macro. This instance will take precedence.

This is a harmless warning and need not concern you. Many users believe they have done something wrong when this warning appears.

(5) If you do not properly execute the macro command definition set and then attempt to use the macro, you will get an error (in SPSS) that reads something like

>Error # 1. Command name: process

>The first word in the line is not recognized as an SPSS Statistics command.

>Execution of this command stops.

It may be that you

(6) Make sure you run the ENTIRE macro command set on the web page. Many users mistakenly leave off the last line and then try to rerun the command set when nothing happens. In SPSS, this will might produce an error that looks something like

>Error # 6805 in column 1. Text: DEFINE

>There is an instance of a DEFINE command nested within another DEFINE.

Nested DEFINE's are not permitted.

Typically there is no way out of this. You’ll have to quit SPSS and start again. Or you may get the error in (5) when you try to use the macro.

(7) If nothing happens when you run the macro command set on the web page, THAT IS OK. The macro will do nothing until you then execute the macro command by feeding it the parameters pertinent to your analysis and data set. The web page describes the acceptable syntax to make the macro do what it can do. Many errors become infinite loops and are nearly impossible to escape. Quitting SPSS or SAS and starting fresh is usually the only option available in such cases.

(8) My macros were written on SPSS for Windows. Most of them work on a Mac as well. If you are using a version of SPSS prior to release 17, you may get nothing but errors. I recommend you upgrade to a more recent version of SPSS.

(9) These macros don’t work with the INCLUDE command. If you are getting errors and are using the INCLUDE command to execute the macro definition commands from a file, try running the macro definition program manually, without the INCLUDE command. Or Try the INSERT command instead.

(10) I no longer support scripts and have removed them from my web page. The custom dialog files (with an .spd extension) install permanently in SPSS and provide a dialog box for setting up the procedure for your analysis.

“Cannot install custom dialog to any of the specified locations: C:\PROGRA~1\IBM\SPSS\STATIS~1\20\ext\lib“.

although the error could take a number of different forms. See this document, and contact your local IT support person.

Now for answers to some frequently asked questions

All

(12) “Can your procedures be used with dichotomous outcomes or mediators?”

The SPSS versions of SOBEL, INDIRECT, and PROCESS allow for dichotomous outcomes.

You will find sources on the web that discuss mediation analysis with a dichotomous mediator or outcome. I can't recommend approaches that emphasize the Sobel test, which has documented problems. It is simple to generate bootstrap confidence intervals for an indirect effect with a dichotomous mediator in Mplus, and the free demo version is all you need if your model is fairly simple (see http://www.statmodel.com). Here is some Mplus code that estimates a simple mediation model with a dichotomous mediator and a dichotomous outcome:

DATA:

FILE IS C:\example.txt;

FORMAT IS free;

VARIABLE:

NAMES ARE x m y;

USEVARIABLES x m y;

CATEGORICAL are y m;

ANALYSIS:

bootstrap = 5000;

MODEL:

m on x; y on m x;

MODEL INDIRECT:

y via m x;

OUTPUT:

cinterval(bcbootstrap);

(13) “It appears that I have evidence of an indirect effect of

This is not only possible, but it is probably much more common than people realize. Modern thinking about mediation analysis does not impose the requirement that there be evidence of a simple association between

(14) “I have a categorical IV with more than two categories. Can I still use SOBEL, INDIRECT or PROCESS?

It is possible with PROCESS or INDIRECT but not with SOBEL. Using PROCESS or INDIRECT, the best approach is to dummy code the categorical IV. If your IV has

For a tutorial on mediation analysis with a multicategorical IV, see Hayes, A. F., & Preacher, K. J. (2014). Statistical mediation analysis with a multicategorical independent variable.

(15) “I have more than one IV and I would like to include them in my mediation model simultaneously. Is this possible? And what if I have multiple DVs?

Yes, it is possible using INDIRECT or PROCESS. If you have

MEDIATE, while designed primarily for modeling the effect of a multicategorical causal agent, can also be used for estimating indirect effects in models with multiple IVs.

Models with multiple IVs or DVs are discussed in Section 6.4 of Hayes (2013).

(16) “What if I want to treat one or more of my variables as latent with multiple indicators?”

For latent variable models, I recommend Mplus, for it has the ability to construct bootstrap confidence intervals for specific and total indirect effects in models with latent variables without having to jump through all the hoops many other covariance structure modeling programs require. If your "latent" variable is a average of indicators and available in your data as such, then technically it isn't a latent variable; it is observed. My macros are appropriate, in that case.

(17) “I am getting an error that reads:

>Error # 34 in column 22. Text: c:\filename.sav

>SPSS Statistics cannot access a file with the given file specification. The

>file specification is either syntactically invalid, specifies an invalid

>drive, specifies a protected directory, specifies a protected file, or

>specifies a non-sharable file.

>This command not executed.”

SPSS is trying to save information that it either saves by default or that you asked it to save. If you get it, the procedure is telling you that it couldn’t save anything during its operation. This is harmless and won’t otherwise affect computations or output. It typically occurs when using a computer that is administered by a technical support person who has not given you write access to the “c:\” part of your hard drive in order to protect your computer from viruses, Trojan horses, or other malicious code that you might mistakenly download when using the internet. See the person who administers your computer to have this protection on your computer disabled. As long as the protection is enabled, the procedures will not be able to save bootstrap estimates or other information you might ask it to save or that it tries to save on its own in the event you want to look at it.

(18) “I am getting an error that reads:

>Error # 12417

>Source operand is singular for INV.

>This command not executed.

This is usually a fatal error. Do not interpret output if you see this. It typically occurs when one or more of the predictor variables in a model is constant or is a perfect linear combination of the other predictors. This error frequently occurs when bootstrapping a small dataset with one or more dichotomous predictors that heavily favors one category or another. Sometimes reducing the number of bootstrap samples will make the problem go away temporarily, but it will reappear at some point, as such a singularity will occur now and then just by chance during resampling. PROCESS has a routine built in that will catch some bootstrap samples that are 'invalid' and replace them, but it won't catch them all.

(19) “I don’t know how to use SPSS syntax. Can you help me?”

If you aren’t familiar with SPSS syntax, you may find the custom dialogs for SOBEL, MODPROBE, INDIRECT, PROCESS, and MEDCURVE easier to use. These programs, once run or installed, construct a windows dialog box that you can use to set up the model. Custom dialog files can be downloaded from the same location the macros can be found. Otherwise, I recommend you find a local expert and ask them for assistance on the use of syntax. Once you become familiar with using syntax, I’d be happy to help you out on matters directly related to my macros.

(20) “I have evidence that one of the paths in my simple mediation model is not linear. Can I use your mediation macros anyway?”

If you have reason to believe that one of the paths is nonlinear (e.g., exponential, quadratic), whether you should use a model that assumes linearity will depend on how comfortable you are with misspecifying the nature of the association by making the simplifying assumption of linearity. I recently published a paper with Kris Preacher on the computation of indirect effects in models with nonlinear paths: Hayes, A. F., & Preacher, K. J. (2010). Quantifying and testing indirect effects in simple mediation models when the constituent paths are nonlinear.

(21) “I find the results from your macros produce results for the individual paths differ from what I get in SPSS and/or SAS’s regression procedure. There must be something wrong with your macros.”

No, there is nothing wrong with my macros. The coefficients and tests of significance you get from my procedures will be exactly the same as what you get from SPSS and SAS's regression procedures when you analyze exactly the same data. Much of the time, discrepancies are the result of users not acknowledging missing data. The macros use listwise deletion based on all variables in the model. So, for example, if some cases are missing data on

Another source of discrepancy is your decision to use the HC3 standard error esitmator in PROCESS. This is an option and not the default. PROCESS for SPSS can produce heteroscedasticity-consistent standard error estimators for all regression coefficients when you ask for them. This will produce discrepancies in standard errors produced by PROCESS relative to what SPSS and SAS's regression procedure generates,

Be careful about doing operations on your data manually such as standardizing or mean centering when you have missing data on other variables in the model. This can produce a situation in which the data set the macro is analyzing after listwise deletion of variables in the model is different than the data set that you used when you conducted those operations manually.

(22) “Some of the regression coefficients in the output are larger than 1. How is this possible? There must be something wrong with your macros.”

There is nothing wrong with the macros. My SPSS and SAS procedures produce regression or path coefficients in unstandardized form. The scale of unstandardized coefficients is determined by the scale of measurement of the variables in the model. As often as not, the coefficients will be greater than 1 in absolute value. This question typically is asked by people who think the output displays standardized coefficients. But even standardized coefficients can be greater than 1. See http://epm.sagepub.com/content/38/4/873.abstract. Unstandardized coefficients are the preferred metric in causal modeling. I strongly discourage the use and reporting of standardized predictors when the independent variable is dichotomous.

(23) “My advisor tells me I should use the Baron and Kenny strategy for assessing mediation. But my reading of the literature tells me this isn’t recommended these days. What should I do?”

You have counted on your advisor for guidance and support. Now return the favor. All but the most stubborn of advisors are open to new ideas, and many are too busy or just don’t care enough to stay informed on recent developments. Give him or her a copy of the relevant literature or a copy of my book and make your case. Try my Beyond Baron and Kenny paper for a start (

(24) "I am interested in mediated moderation rather than moderated mediation. Do you have a macro for that?"

If you are interested in knowing whether an interaction's effect on an outcome is mediated, use PROCESS or INDIRECT. PROCESS has two models built in for estimating the indirect effect of a product (model 8 for a two-way interaction, model 12 for a three-way interaction).

INDIRECT can also be used, though doing so is bit more tedious than when using PROCESS. If your IV is X and your moderator is W (and X and W are either dichotomous or continuous), create a variable XW that is the product of X and W. Then use XW as your IV and X and W as covariates. A bootstrap confidence interval for the indirect effect that INDIRECT produces can be used to test whether the "moderation is mediated."

(25) "In my mediation analysis examining the direct and indirect effects of X on Y through M, the path from X to M is not statistically significant. Does this mean there is no way that M could mediate the relationship between X and Y. According to Baron and Kenny (1986), it cannot. Should I bother estimating the indirect effect in this case?"

These days, we don't rely on statistical significance criteria for the individual paths in a mediation model in order to assess whether M functions as a mediator. The pattern of significance or nonsignificance for individual paths in a mediation model is not pertinent to whether the indirect effect is significant. You absolutely should estimate the indirect effect. See Hayes (2009) for a brief discussion [PDF], or Chapter 6 of Hayes (2013).

(26) "I am looking at the output from INDIRECT and comparing it to the output shown in Zhao et al's 2010 Journal of Consumer Research paper. Why are the direct and total effects labelled differently?"

Zhao et al is a nice article that will hopefully reduce the use of the Sobel test by researchers in the business and marketing fields in favor of the superior and more appropriate bootstrap confidence interval. But regrettably, Zhao et al changed the INDIRECT output in their JCR article so that it does not correspond to the output actually produced by INDIRECT. They used the less common convention of denoting the total effect c' and the direct effect c throughout their article. So their labels are different from what INDIRECT actually generates. The convention in the bulk of the mediation literature since the publication of Baron and Kenny (1986) is to denote the total effect c and the direct effect c' (some use tau and tau', respectively). Of course, labels are arbitrary. But their decision to change the output in their article such that it doesn't correspond to output that INDIRECT generates is producing some confusion among readers of the JCR article.

(27) Will any of your macros produce standardized coefficients?

The regression/path coefficients that my macros produce are all in unstandardized form. For mediation analysis, I recommend not reporting standardized coefficients, especially when your causal agent/independent variable is dichotomous, for standardized coefficients for dichotomous variables generally have no useful substantive interpretation. You can standardize your variables first prior to the use of the macro, and this will generate standardized coefficients. However, the bootstrap confidence intervals you will get from SOBEL, INDIRECT, MODMED, MEDIATE, PROCESS, and MED3/C should not be interpreted as confidence intervals for the standardized effects, for that is not what they are.

(28) "How did you learn to program macros?"

I am more or less self-taught, though I can in part credit my father for buying me a VIC-20 when I was in high school. I learned to program on that, and once you grasp the logic of programming, it is a skill that generalizes and anything is possible.

(29) "I downloaded and ran your macro but nothing happened. I don't see a dialog box anywhere. I think there must be something wrong with your code."

There is nothing wrong with the code. My macros don't create a dialog box. If you ran the macro you downloaded and nothing happened, that is good. Nothing should happen. See the documentation for instructions on how to use the macro. Only the custom dialog files produce a custom dialog box. To install a custom dialog file, see these instructions. The dialog box will appear in the location mentioned in the documentation for whatever procedure you are using.

(30). "How can I tell whether I can claim full or partial mediation from the output of one of your mediation macros?"

These are based on the relative size and significance of the total and direct effect. All this information is in the output. "Full" or "Complete" and "Partial" mediation are outdated, 20th century concepts that have no place in 21st century mediation analysis. I recommend you avoid the use of these terms, and don't attempt to interpret your analysis based on the relative size and significance of the total and direct effects. For a discussion, see section 6.1 in Hayes (2013).

(31). " I am having trouble installing your custom dialogs. i keep getting an error that reads “Cannot install custom dialog to any of the specified locations: C:\PROGRA~1\IBM\SPSS\STATIS~1\20\ext\lib“.

You do not have administrative access to your machine. You must have administrative access to install custom dialog files, and you must run SPSS as an administrator. Contact your local technical support guru for assistance. See point #10 above.

(32). "My data come from a complex sampling plan. Can your macros use sampling weights?"

No.

(33) I tried to run your macro but only received the following error message: "Error : Expecting 'Declare | Delegate | Event | Function | Property | Sub | Const | Dim | Private | Public | Friend | Enum | Type' At Line No : 1 ." What I am doing wrong?

You are trying to run a macro as a script. I no longer write or support scripts. For instructions on how to execute macros, consult the documentation for the macro you are using. Macros must be run as syntax files, not as script files.

(34) "Can I use PROCESS for multiple regression without mediation or moderation?"

PROCESS can generate OLS or logistic regression output for a model that does not contain a mediation or moderation component. Use model 4, specifying one predictor as X, one as M, and the remaining predictors (if any) as covariates. Ignore all output PROCESS gives except the model of Y. Turn off bootstrapping (boot=0) to speed things up if you want. Or save the bootstrap estimates if you want, thereby allowing you to (manually) construct bootstrap confidence intervals for all regression coefficients.

If you are doing this only because you want to use the HC3 standard error estimator in regression analysis, try my HCREG procedure on my macros page.

(35) "What is the "omnibus indirect effect" that MEDIATE generates?

This statistic is a work in progress. As there is nothing written about this anywhere that I have made public (with the exception of an old draft of a manuscript I am no longer distributing) you should just ignore this for now.

(36) "Is there a way of getting SPSS to load your macros automatically so I don't have to each time I want to use them"?

You have two decent options. One is to produce a script that will automatically load and execute each time you open SPSS. Once you have done this, you don't have to think about ever executing the macro yourself. Eventually I will produce a document for how to do this. In the mean time, see here.

The second option is to save the macro to a particular location and then call it with an INSERT statement at the top of your SPSS program, before you use the macro. For example, in Windows, perhaps you have the PROCESS macro saved on your computer in location c:\process\process.sps. At the top of your SPSS program, add INSERT FILE = 'c:\process\process.sps'.

When you do so, SPSS will first look for PROCESS in this location and execute it before it executes anything else in your program.

(37) "My confidence intervals for indirect effects change each time I do a mediation analysis SOBEL, INDIRECT, MODMED, MEDIATE, or PROCESS. There must be something wrong with your code."

There is nothing wrong with the code. As discussed in Chapter 4 of Introduction to Mediation, Moderation, and Conditional Process Analysis, bootstrap sampling is a random resampling process. The end points of a the confidence interval are determined by percentiles in the distribution of bootstrap estimates of the indirect effect. If this bothers you, use PROCESS with a custom seed for the random number generator and use this seed each time you do the analysis. See Appendix A for instructions. Alternatively, set the number of bootstrap samples to a very large number in order to minimize sampling error in the estimation of the end points of the confidence interval.

(38) "I am getting a warning in PROCESS that reads

WARNING: Bootstrap CI endpoints below not trustworthy. Decrease confidence or increase bootstraps"

This is generated by the bias correction routine when generating bootstrap confidence intervals. It occurs when the bias correction is large and is more likely with small sample sizes. If you can't get it to go away by increasing the number of bootstrap samples or lowering your desired confidence, use a percentile confidence interval instead or, for models 4 or 5, a Monte Carlo confidence interval.

(39) Can I use data from one of the imputation procedures in SPSS or SAS?

None of my macros integrate with the missing data imputation routines built into SPSS or SAS. If the data file you are analyzing is tagged as derived from the imputation routine, it will not analyze it and an error is likely to result. The problem in SPSS is that the MATRIX language does not honor split file designations.

(40) What is the "index of moderated mediation" that PROCESS produces for some models?

For a discussion of the index of moderated mediation, see Hayes, A. F. (2015). An index and test of linear moderated mediation.

(41) “Do you have any examples of how to report the results of the analyses you advocate in your articles?”

I discuss writing about moderation, mediation, and conditional process analysis in Chapters 6, 9, and 12 in Hayes (2013).

(1) Read the article corresponding to the macro before you attempt to use it. I also recommend you download and also

**read**the documentation for the macro, as it may answer many questions you might have. I get many questions about my macros, a substantial number of them which are answered in the documentation. As a general rule, I don't answer questions sent to me by email that are answered in the documentation. The documentation for PROCESS is Appendix A in Introduction to Mediation, Moderation, and Conditional Process Analysis.(2) Download and run the macro definition command set (the .sps file or .sas file) EXACTLY AS IS from the web page.

**Do not modify the code at all.**Many users mistakenly change the program by customizing it to their own data or variables. This will produce an error. DO NOT MODIFY THE MACRO IN ANY WAY. JUST RUN IT EXACTLY AS IS. IT WILL EITHER DO NOTHING, OR SPSS or SAS WILL PRINT BACK THE COMMANDS IN THE OUTPUT OR LOG WINDOW. This is good. After you have done this, you then execute a properly formatted command as described in the documentation for the macro you are using.(3) All macros produce an SPSS or SAS command defined by the macro name. It is through this command that you get the macro to work. The syntax structure for the macro can be found in the documentation or, in some cases, in the published article that describes the macro’s functionality. For lessons on how to run SPSS commands through the syntax system, consult the SPSS help files or an SPSS manual.

(4) You do not need to run the macro command definition set more than once. Although there is no harm in doing so, the second time you do, you will get a WARNING message from SPSS saying something like

>Warning # 6804 in column 3.

>The macro name specified on the DEFINE command duplicates the

>name of a previously defined macro. This instance will take precedence.

This is a harmless warning and need not concern you. Many users believe they have done something wrong when this warning appears.

(5) If you do not properly execute the macro command definition set and then attempt to use the macro, you will get an error (in SPSS) that reads something like

>Error # 1. Command name: process

>The first word in the line is not recognized as an SPSS Statistics command.

>Execution of this command stops.

It may be that you

*think*you executed the macro, but SPSS doesn't believe you have, and SPSS is usually right. One possible cause of this error is that you executed the macro in one copy of SPSS but you have another copy of SPSS running simultaneously where you did not execute the macro, and you are trying to run your command in the version in which you did not execute the macro. Another possibility is that you didn't run the entire program but only part of it.(6) Make sure you run the ENTIRE macro command set on the web page. Many users mistakenly leave off the last line and then try to rerun the command set when nothing happens. In SPSS, this will might produce an error that looks something like

>Error # 6805 in column 1. Text: DEFINE

>There is an instance of a DEFINE command nested within another DEFINE.

Nested DEFINE's are not permitted.

Typically there is no way out of this. You’ll have to quit SPSS and start again. Or you may get the error in (5) when you try to use the macro.

(7) If nothing happens when you run the macro command set on the web page, THAT IS OK. The macro will do nothing until you then execute the macro command by feeding it the parameters pertinent to your analysis and data set. The web page describes the acceptable syntax to make the macro do what it can do. Many errors become infinite loops and are nearly impossible to escape. Quitting SPSS or SAS and starting fresh is usually the only option available in such cases.

(8) My macros were written on SPSS for Windows. Most of them work on a Mac as well. If you are using a version of SPSS prior to release 17, you may get nothing but errors. I recommend you upgrade to a more recent version of SPSS.

(9) These macros don’t work with the INCLUDE command. If you are getting errors and are using the INCLUDE command to execute the macro definition commands from a file, try running the macro definition program manually, without the INCLUDE command. Or Try the INSERT command instead.

(10) I no longer support scripts and have removed them from my web page. The custom dialog files (with an .spd extension) install permanently in SPSS and provide a dialog box for setting up the procedure for your analysis.

**You must have administrative access to your machine in order to install a custom dialog file.**If you are getting an installation error when attempting to install an *.spd file, this is because you aren't authorized to install on your machine. An example installation error might look something like:“Cannot install custom dialog to any of the specified locations: C:\PROGRA~1\IBM\SPSS\STATIS~1\20\ext\lib“.

although the error could take a number of different forms. See this document, and contact your local IT support person.

Now for answers to some frequently asked questions

**(11) “I am interested in conducting a one-tailed test. Is there a way of generating a one-tailed test in your macros?”**All

*p*-values generated by my procedures are based on the assumption of symmetry in the sampling distribution of the effect. So if the effect is in the predicted direction, you can cut the*p*-value in half for a one-tailed p-value. For confidence intervals for indirect effects based on bootstrapping, request a 90% confidence interval to conduct the equivalent of a one-tailed test. Note that SOBEL prints only 95 and 99% confidence intervals and there is no way of changing that. Use INDIRECT or PROCESS if you want to specify a 90% confidence interval. Both INDIRECT and PROCESS allow you to specify any desired confidence for a bootstrap confidence interval.(12) “Can your procedures be used with dichotomous outcomes or mediators?”

The SPSS versions of SOBEL, INDIRECT, and PROCESS allow for dichotomous outcomes.

**However, they are not appropriate when a proposed mediator is dichotomous**. All three of these macros have the intelligence to detect whether the outcome is dichotomous, and they estimate the coefficients of the model accordingly using logistic regression. The MODMED macro should not be used with a dichotomous outcome or a dichotomous mediators (although it will not prevent you from doing so, the results will be meaningless). The SAS versions of SOBEL and INDIRECT still assume continuous outcomes. PROCESS works with dichotomous outcomes. I recommend using PROCESS.You will find sources on the web that discuss mediation analysis with a dichotomous mediator or outcome. I can't recommend approaches that emphasize the Sobel test, which has documented problems. It is simple to generate bootstrap confidence intervals for an indirect effect with a dichotomous mediator in Mplus, and the free demo version is all you need if your model is fairly simple (see http://www.statmodel.com). Here is some Mplus code that estimates a simple mediation model with a dichotomous mediator and a dichotomous outcome:

DATA:

FILE IS C:\example.txt;

FORMAT IS free;

VARIABLE:

NAMES ARE x m y;

USEVARIABLES x m y;

CATEGORICAL are y m;

ANALYSIS:

bootstrap = 5000;

MODEL:

m on x; y on m x;

MODEL INDIRECT:

y via m x;

OUTPUT:

cinterval(bcbootstrap);

(13) “It appears that I have evidence of an indirect effect of

*X*on*Y*through a proposed mediator, but there is no evidence of an association between*X*and*Y*. Is this possible? What should I do?”This is not only possible, but it is probably much more common than people realize. Modern thinking about mediation analysis does not impose the requirement that there be evidence of a simple association between

*X*and*Y*in order to estimate and test hypotheses about indirect effects. See Hayes, A. F.(2009). Beyond Baron and Kenny: Statistical mediation analysis in the new millennium.*Communication Monographs*,*76*, 408-420. [PDF] Also see Chapter 6 of Hayes (2013).(14) “I have a categorical IV with more than two categories. Can I still use SOBEL, INDIRECT or PROCESS?

It is possible with PROCESS or INDIRECT but not with SOBEL. Using PROCESS or INDIRECT, the best approach is to dummy code the categorical IV. If your IV has

*k*categories, construct*k*-1 dummy variables and then run INDIRECT or PROCESS*k*-1 times. With each run, make one dummy variable the IV and the other one(s) the covariate(s). You will not get a single test of the indirect effect, but you will get indirect effects for each category relative to the reference category in the dummy coding scheme. See the documentation. MEDIATE was designed specifically for estimating indirect effects in a mediation model with a multicategorical IV.For a tutorial on mediation analysis with a multicategorical IV, see Hayes, A. F., & Preacher, K. J. (2014). Statistical mediation analysis with a multicategorical independent variable.

*British Journal of Mathematical and Statistical Psychology, 67,*451-470.*[email me] DOI: 10.1111/bmsp.12028 [online supplement]*(15) “I have more than one IV and I would like to include them in my mediation model simultaneously. Is this possible? And what if I have multiple DVs?

Yes, it is possible using INDIRECT or PROCESS. If you have

*k*IVs, run INDIRECT or PROCESS*k*times, each time with one of the IVs as the IV and the others as covariates. You will not get a single estimate or test of the total indirect effect across all IVs, but you will get estimates and tests for each IV. This feature of INDIRECT is documented in the last paragraph of Preacher and Hayes (2008) and for PROCESS in Chapter 6 of Hayes (2013) . With multiple DVs, there really is no advantage to trying to estimate the direct and indirect effects simultaneously. Just run the macro once for each DV. You will get essentially the same results as you would had you estimated the effects for each DV simultaneously as a structural equation model. See Chapter 6 of Hayes (2013).MEDIATE, while designed primarily for modeling the effect of a multicategorical causal agent, can also be used for estimating indirect effects in models with multiple IVs.

Models with multiple IVs or DVs are discussed in Section 6.4 of Hayes (2013).

(16) “What if I want to treat one or more of my variables as latent with multiple indicators?”

For latent variable models, I recommend Mplus, for it has the ability to construct bootstrap confidence intervals for specific and total indirect effects in models with latent variables without having to jump through all the hoops many other covariance structure modeling programs require. If your "latent" variable is a average of indicators and available in your data as such, then technically it isn't a latent variable; it is observed. My macros are appropriate, in that case.

(17) “I am getting an error that reads:

>Error # 34 in column 22. Text: c:\filename.sav

>SPSS Statistics cannot access a file with the given file specification. The

>file specification is either syntactically invalid, specifies an invalid

>drive, specifies a protected directory, specifies a protected file, or

>specifies a non-sharable file.

>This command not executed.”

SPSS is trying to save information that it either saves by default or that you asked it to save. If you get it, the procedure is telling you that it couldn’t save anything during its operation. This is harmless and won’t otherwise affect computations or output. It typically occurs when using a computer that is administered by a technical support person who has not given you write access to the “c:\” part of your hard drive in order to protect your computer from viruses, Trojan horses, or other malicious code that you might mistakenly download when using the internet. See the person who administers your computer to have this protection on your computer disabled. As long as the protection is enabled, the procedures will not be able to save bootstrap estimates or other information you might ask it to save or that it tries to save on its own in the event you want to look at it.

(18) “I am getting an error that reads:

>Error # 12417

>Source operand is singular for INV.

>This command not executed.

This is usually a fatal error. Do not interpret output if you see this. It typically occurs when one or more of the predictor variables in a model is constant or is a perfect linear combination of the other predictors. This error frequently occurs when bootstrapping a small dataset with one or more dichotomous predictors that heavily favors one category or another. Sometimes reducing the number of bootstrap samples will make the problem go away temporarily, but it will reappear at some point, as such a singularity will occur now and then just by chance during resampling. PROCESS has a routine built in that will catch some bootstrap samples that are 'invalid' and replace them, but it won't catch them all.

(19) “I don’t know how to use SPSS syntax. Can you help me?”

If you aren’t familiar with SPSS syntax, you may find the custom dialogs for SOBEL, MODPROBE, INDIRECT, PROCESS, and MEDCURVE easier to use. These programs, once run or installed, construct a windows dialog box that you can use to set up the model. Custom dialog files can be downloaded from the same location the macros can be found. Otherwise, I recommend you find a local expert and ask them for assistance on the use of syntax. Once you become familiar with using syntax, I’d be happy to help you out on matters directly related to my macros.

(20) “I have evidence that one of the paths in my simple mediation model is not linear. Can I use your mediation macros anyway?”

If you have reason to believe that one of the paths is nonlinear (e.g., exponential, quadratic), whether you should use a model that assumes linearity will depend on how comfortable you are with misspecifying the nature of the association by making the simplifying assumption of linearity. I recently published a paper with Kris Preacher on the computation of indirect effects in models with nonlinear paths: Hayes, A. F., & Preacher, K. J. (2010). Quantifying and testing indirect effects in simple mediation models when the constituent paths are nonlinear.

*Multivariate Behavioral Research*,*45*, 627-660. You can find the macro discussed in this paper here.(21) “I find the results from your macros produce results for the individual paths differ from what I get in SPSS and/or SAS’s regression procedure. There must be something wrong with your macros.”

No, there is nothing wrong with my macros. The coefficients and tests of significance you get from my procedures will be exactly the same as what you get from SPSS and SAS's regression procedures when you analyze exactly the same data. Much of the time, discrepancies are the result of users not acknowledging missing data. The macros use listwise deletion based on all variables in the model. So, for example, if some cases are missing data on

*Y*, it will throw all those cases out of the analysis estimating the effect of*X*on*M*, even if those cases are complete on*X*and*M*. And cases missing on*M*will be thrown of the computation of the total effect of*X*on*Y*even though*M*is not relevant to the estimation of the total effect. This is standard practice in the estimation of models such as these. Indeed, one could argue that it would be inappropriate to piece together a causal model using tests of significance when the analyses for different paths are based on different subsets of the data. You can determine whether missing data is producing the discrepancies by comparing the sample sizes in your regression analysis versus what the macro is using.Another source of discrepancy is your decision to use the HC3 standard error esitmator in PROCESS. This is an option and not the default. PROCESS for SPSS can produce heteroscedasticity-consistent standard error estimators for all regression coefficients when you ask for them. This will produce discrepancies in standard errors produced by PROCESS relative to what SPSS and SAS's regression procedure generates,

*as it should*. For a discussion of the HC3 estimator, see Hayes and Cai (2007,*Behavior Research Methods*).Be careful about doing operations on your data manually such as standardizing or mean centering when you have missing data on other variables in the model. This can produce a situation in which the data set the macro is analyzing after listwise deletion of variables in the model is different than the data set that you used when you conducted those operations manually.

(22) “Some of the regression coefficients in the output are larger than 1. How is this possible? There must be something wrong with your macros.”

There is nothing wrong with the macros. My SPSS and SAS procedures produce regression or path coefficients in unstandardized form. The scale of unstandardized coefficients is determined by the scale of measurement of the variables in the model. As often as not, the coefficients will be greater than 1 in absolute value. This question typically is asked by people who think the output displays standardized coefficients. But even standardized coefficients can be greater than 1. See http://epm.sagepub.com/content/38/4/873.abstract. Unstandardized coefficients are the preferred metric in causal modeling. I strongly discourage the use and reporting of standardized predictors when the independent variable is dichotomous.

(23) “My advisor tells me I should use the Baron and Kenny strategy for assessing mediation. But my reading of the literature tells me this isn’t recommended these days. What should I do?”

You have counted on your advisor for guidance and support. Now return the favor. All but the most stubborn of advisors are open to new ideas, and many are too busy or just don’t care enough to stay informed on recent developments. Give him or her a copy of the relevant literature or a copy of my book and make your case. Try my Beyond Baron and Kenny paper for a start (

*Communication Monographs*, 2009, vol 76, p. 408-420). [PDF](24) "I am interested in mediated moderation rather than moderated mediation. Do you have a macro for that?"

If you are interested in knowing whether an interaction's effect on an outcome is mediated, use PROCESS or INDIRECT. PROCESS has two models built in for estimating the indirect effect of a product (model 8 for a two-way interaction, model 12 for a three-way interaction).

**As I discuss in my book on mediation analysis, in my opinion, mediated moderation is rarely very interesting or substantively interpretable.**The same model can be conceptualized in terms of moderated mediation, and the results usually are more meaningful when you change your interpretative focus from the indirect effect of a product to the conditional indirect effects. I recommend avoiding use of the term "mediated moderation" or any attempt to muster support for such a process. See Chapter 11 of Hayes (2013).INDIRECT can also be used, though doing so is bit more tedious than when using PROCESS. If your IV is X and your moderator is W (and X and W are either dichotomous or continuous), create a variable XW that is the product of X and W. Then use XW as your IV and X and W as covariates. A bootstrap confidence interval for the indirect effect that INDIRECT produces can be used to test whether the "moderation is mediated."

(25) "In my mediation analysis examining the direct and indirect effects of X on Y through M, the path from X to M is not statistically significant. Does this mean there is no way that M could mediate the relationship between X and Y. According to Baron and Kenny (1986), it cannot. Should I bother estimating the indirect effect in this case?"

These days, we don't rely on statistical significance criteria for the individual paths in a mediation model in order to assess whether M functions as a mediator. The pattern of significance or nonsignificance for individual paths in a mediation model is not pertinent to whether the indirect effect is significant. You absolutely should estimate the indirect effect. See Hayes (2009) for a brief discussion [PDF], or Chapter 6 of Hayes (2013).

(26) "I am looking at the output from INDIRECT and comparing it to the output shown in Zhao et al's 2010 Journal of Consumer Research paper. Why are the direct and total effects labelled differently?"

Zhao et al is a nice article that will hopefully reduce the use of the Sobel test by researchers in the business and marketing fields in favor of the superior and more appropriate bootstrap confidence interval. But regrettably, Zhao et al changed the INDIRECT output in their JCR article so that it does not correspond to the output actually produced by INDIRECT. They used the less common convention of denoting the total effect c' and the direct effect c throughout their article. So their labels are different from what INDIRECT actually generates. The convention in the bulk of the mediation literature since the publication of Baron and Kenny (1986) is to denote the total effect c and the direct effect c' (some use tau and tau', respectively). Of course, labels are arbitrary. But their decision to change the output in their article such that it doesn't correspond to output that INDIRECT generates is producing some confusion among readers of the JCR article.

(27) Will any of your macros produce standardized coefficients?

The regression/path coefficients that my macros produce are all in unstandardized form. For mediation analysis, I recommend not reporting standardized coefficients, especially when your causal agent/independent variable is dichotomous, for standardized coefficients for dichotomous variables generally have no useful substantive interpretation. You can standardize your variables first prior to the use of the macro, and this will generate standardized coefficients. However, the bootstrap confidence intervals you will get from SOBEL, INDIRECT, MODMED, MEDIATE, PROCESS, and MED3/C should not be interpreted as confidence intervals for the standardized effects, for that is not what they are.

(28) "How did you learn to program macros?"

I am more or less self-taught, though I can in part credit my father for buying me a VIC-20 when I was in high school. I learned to program on that, and once you grasp the logic of programming, it is a skill that generalizes and anything is possible.

(29) "I downloaded and ran your macro but nothing happened. I don't see a dialog box anywhere. I think there must be something wrong with your code."

There is nothing wrong with the code. My macros don't create a dialog box. If you ran the macro you downloaded and nothing happened, that is good. Nothing should happen. See the documentation for instructions on how to use the macro. Only the custom dialog files produce a custom dialog box. To install a custom dialog file, see these instructions. The dialog box will appear in the location mentioned in the documentation for whatever procedure you are using.

(30). "How can I tell whether I can claim full or partial mediation from the output of one of your mediation macros?"

These are based on the relative size and significance of the total and direct effect. All this information is in the output. "Full" or "Complete" and "Partial" mediation are outdated, 20th century concepts that have no place in 21st century mediation analysis. I recommend you avoid the use of these terms, and don't attempt to interpret your analysis based on the relative size and significance of the total and direct effects. For a discussion, see section 6.1 in Hayes (2013).

(31). " I am having trouble installing your custom dialogs. i keep getting an error that reads “Cannot install custom dialog to any of the specified locations: C:\PROGRA~1\IBM\SPSS\STATIS~1\20\ext\lib“.

You do not have administrative access to your machine. You must have administrative access to install custom dialog files, and you must run SPSS as an administrator. Contact your local technical support guru for assistance. See point #10 above.

(32). "My data come from a complex sampling plan. Can your macros use sampling weights?"

No.

(33) I tried to run your macro but only received the following error message: "Error : Expecting 'Declare | Delegate | Event | Function | Property | Sub | Const | Dim | Private | Public | Friend | Enum | Type' At Line No : 1 ." What I am doing wrong?

You are trying to run a macro as a script. I no longer write or support scripts. For instructions on how to execute macros, consult the documentation for the macro you are using. Macros must be run as syntax files, not as script files.

(34) "Can I use PROCESS for multiple regression without mediation or moderation?"

PROCESS can generate OLS or logistic regression output for a model that does not contain a mediation or moderation component. Use model 4, specifying one predictor as X, one as M, and the remaining predictors (if any) as covariates. Ignore all output PROCESS gives except the model of Y. Turn off bootstrapping (boot=0) to speed things up if you want. Or save the bootstrap estimates if you want, thereby allowing you to (manually) construct bootstrap confidence intervals for all regression coefficients.

If you are doing this only because you want to use the HC3 standard error estimator in regression analysis, try my HCREG procedure on my macros page.

(35) "What is the "omnibus indirect effect" that MEDIATE generates?

This statistic is a work in progress. As there is nothing written about this anywhere that I have made public (with the exception of an old draft of a manuscript I am no longer distributing) you should just ignore this for now.

(36) "Is there a way of getting SPSS to load your macros automatically so I don't have to each time I want to use them"?

You have two decent options. One is to produce a script that will automatically load and execute each time you open SPSS. Once you have done this, you don't have to think about ever executing the macro yourself. Eventually I will produce a document for how to do this. In the mean time, see here.

The second option is to save the macro to a particular location and then call it with an INSERT statement at the top of your SPSS program, before you use the macro. For example, in Windows, perhaps you have the PROCESS macro saved on your computer in location c:\process\process.sps. At the top of your SPSS program, add INSERT FILE = 'c:\process\process.sps'.

When you do so, SPSS will first look for PROCESS in this location and execute it before it executes anything else in your program.

(37) "My confidence intervals for indirect effects change each time I do a mediation analysis SOBEL, INDIRECT, MODMED, MEDIATE, or PROCESS. There must be something wrong with your code."

There is nothing wrong with the code. As discussed in Chapter 4 of Introduction to Mediation, Moderation, and Conditional Process Analysis, bootstrap sampling is a random resampling process. The end points of a the confidence interval are determined by percentiles in the distribution of bootstrap estimates of the indirect effect. If this bothers you, use PROCESS with a custom seed for the random number generator and use this seed each time you do the analysis. See Appendix A for instructions. Alternatively, set the number of bootstrap samples to a very large number in order to minimize sampling error in the estimation of the end points of the confidence interval.

(38) "I am getting a warning in PROCESS that reads

WARNING: Bootstrap CI endpoints below not trustworthy. Decrease confidence or increase bootstraps"

This is generated by the bias correction routine when generating bootstrap confidence intervals. It occurs when the bias correction is large and is more likely with small sample sizes. If you can't get it to go away by increasing the number of bootstrap samples or lowering your desired confidence, use a percentile confidence interval instead or, for models 4 or 5, a Monte Carlo confidence interval.

(39) Can I use data from one of the imputation procedures in SPSS or SAS?

None of my macros integrate with the missing data imputation routines built into SPSS or SAS. If the data file you are analyzing is tagged as derived from the imputation routine, it will not analyze it and an error is likely to result. The problem in SPSS is that the MATRIX language does not honor split file designations.

(40) What is the "index of moderated mediation" that PROCESS produces for some models?

For a discussion of the index of moderated mediation, see Hayes, A. F. (2015). An index and test of linear moderated mediation.

*Multivariate Behavioral Research, 50*, 1-22. [PDF].(41) “Do you have any examples of how to report the results of the analyses you advocate in your articles?”

I discuss writing about moderation, mediation, and conditional process analysis in Chapters 6, 9, and 12 in Hayes (2013).