# Troubleshooting

## K2K not working

If you run CEM for SPSS with the K2K option and you get matched treatment and control groups that are different sizes, try to update CEM to the latest version using the following command in SPSS:

BEGIN PROGAM R.
install.packages("cem", repos = "http://cran.rstudio.com", type = "source")
END PROGRAM.

## "No package called 'cem'

If you try to run CEM for SPSS and you receive the error message: library(cem): there is no package called 'cem', then do the following:

1. Open the version of R associated with your version of SPSS (see above) and type the following line while connect to the internet and press Enter:

install.packages("cem")

2. You should be presented with a list of mirrors from which to choose. Pick the mirror closest to your current location. R should proceed to download and install the relevant files.

3. To ensure that the installation worked, type the following and press Enter:

library(cem)

If you receive no error messages, then CEM should be properly installed and you can now run CEM in SPSS.

## Permissions

There can often be issues with permissions on Windows systems when attempting to install CEM for SPSS. To fix this problem, you need to setup a local, user-specific directory for the CEM extension.

### Windows 7

1. Create a folder called SPSS-extensions in your My Documents folder. Inside of this folder, create another folder called dialog.

2. Open the Start Menu and type Accounts in the Start Search field. Under Control Panel, select User Accounts

3. Click on the Change my environmental variables option on the left-hand panel of the newly opened window.

4. Add the following user variables by clicking on the top-most New... button. Use the following variable names and values:

• Variable: PYTHONPATH Value: %USERPROFILE%\Documents\SPSS-extensions

• Variable: SPSS_EXTENSIONS_PATH Value: %USERPROFILE%\Documents\SPSS-extensions

• Variable: SPSS_CDIALOGS_PATH Value: %USERPROFILE%\Documents\SPSS-extensions\dialog

After adding all of these, hit the OK button.

5. Close any open instances of SPSS. Start SPSS and install the cem.spe file from the Utilities > Extension Bundles > Install Extension Bundle... menu item. You should see a dialog box that says "Extension bundle successfully installed." Restart SPSS and try to use CEM again.

### Windows Vista

1. Create a folder called SPSS-extensions in your My Documents folder. Inside of this folder, create another folder called dialog.

2. Open the Start Menu and type Accounts in the Start Search field. Under programs, select User Accounts.

3. In the User Accounts window, under Tasks, select Change my environment variables.

4. Add the following "User variables" by clicking on the top-most New... button. Use the following variable names and values:

• Variable: PYTHONPATH Value: %USERPROFILE%\Documents\SPSS-extensions

• Variable: SPSS_EXTENSIONS_PATH Value: %USERPROFILE%\Documents\SPSS-extensions

• Variable: SPSS_CDIALOGS_PATH Value: %USERPROFILE%\Documents\SPSS-extensions\dialog

After adding all of these, hit the OK button.

5. Close any open instances of SPSS. Start SPSS and install the cem.spe file from the Utilities > Extension Bundles > Install Extension Bundle... menu item. You should see a dialog box that says "Extension bundle successfully installed." Restart SPSS and try to use CEM again.

### Windows XP

1. Create a folder called SPSS-extensions in your My Documents folder. Inside of this folder, create another folder called dialog.

2. From the Start Menu, right-click My Computer and select Properties. Click the Advanced tab.

3. Click the Environmental Variables button.

4. Add the following "User variables" by clicking on the top-most New... button. Use the following variable names and values:

• Variable: PYTHONPATH Value: %USERPROFILE%\My Documents\SPSS-extensions

• Variable: SPSS_EXTENSIONS_PATH Value: %USERPROFILE%\My Documents\SPSS-extensions

• Variable: SPSS_CDIALOGS_PATH Value: %USERPROFILE%\My Documents\SPSS-extensions\dialog

After adding all of these, hit the OK button.

5. Close any open instances of SPSS. Start SPSS and install the cem.spe file from the Utilities > Extension Bundles > Install Extension Bundle... menu item. You should see a dialog box that says "Extension bundle successfully installed." Restart SPSS and try to use CEM again.