>> Before doing this though, we want to make sure that our categorical explanatory

variables have one group that is coded zero and

that we center our quantitative variables.

Our major depression variable is already coded.

One equals depression and zero equals no depression.

However our quantitative number of cigarettes smoked variable ranges

from 1 to 98.

Because zero is not a valid value for

this variable we should center the variable by subtracting the mean number of

cigarettes smoked from the actual value for each observation.

Going back to the SAS program for this example, we first need to find the mean of

the number cigarettes variable by using the means procedure.

The mean is 13.3642586.

We can add this code to center the number of cigarettes smoked variable.

Because we are doing some additional data management,

we need to create a new temporary data set,

in SAS all data management that we do must be within a data set.

So we create a new data set new2 from the data set we were currently working with,

which is called new in this example.

Then we create a new variable called numberscigsmoked _c,

which equals the name of our original number of cigarettes variable

minus the mean, followed by a semicolon.

Then we type run; to run the code.

We can check to see if the variable is properly centered by calculating the mean

of our centered variable using the means procedure.

We can see the mean is equal to negative zero point then seven zeroes

four four eight seven which essentially centers the variable at zero.

We can now use the centered variable in our regression analysis.

Here is the output.

We examine the P values and parameter estimates for each predictor variable,

i.e., our explanatory variable, depression, and

our potential confounder, number of cigarettes smoked.

As you can see, both P values are less than 0.05.

And both of the parameter estimates are positive,

indicating that having major depression and smoking more cigarettes

is associated with having a greater number of nicotine dependent symptoms.