# What method can be used to correlate variables

I know a little about statistics but not much. I'm interested in learning some new methods to what seems a common problem in engineering/science.

My Background: I have an engineering/science backgroun, and am pretty good with math. I have used the major mathematics software (Matlab, Mathematica, etc.), while dabbled in Python/C. I am not a statistician, but I think I can pick up the fundamentals if I apply myself. I have only taken one statistics course in college. The extent of my statistics use right now is averages/standard deviation of data, with occasional linear regression.

A sample problem: To answer the question on who is likely to recycle if recycling services were available and why. Perhaps there are a handful variables of interest (gender, age, geographic location, socioeconomic status, education, etc.). Let's assume I have data on a large population (probably a problem within itself). What sort of method could be used to answer this? Would this be a regression problem? Is this model development? How can I make predictions on whether someone would recycle based on the variables of interest?

Extra thanks if you can point me to resources (book, website, etc.) that can help, or software I could use.

Any suggestions?

You don't describe the data in great detail but regression sounds like a reasonable approach here. There are different flavors of regression depending on how the outcome variable is distributed. The most likely distributions are normal, binomial, poisson, ordinal, multi-outcome categorical.

R is the most popular statistical software among academic statisticians and the people on this site. But there are many other options and you may not have a strong reason to switch from Matlab or Mathematica since you say you are already comfortable with those tools. I think Jennifer Hill & Andrew Gelman's book on multi-level regression would be great for you. It uses R, but you'd benefit from the concepts even if you had to have other resources to apply the ideas to Matlab or Mathematica.

• I guess I didn't even think about different data types. I guess that's the non-statistician in me. :) Most data I work with is of a numerical type (pressure, temperature, etc.), but I guess my example isn't so cut and dried. Thanks for the reply. Mar 8, 2013 at 15:27

Your problem might also be thought of as a discriminant analysis problem, in which you attemp to classify people in one of two groups (does recycle/does not recycle) on the basis of some predictors. Linear discriminant analysis is a common technique, related to linear regression already suggested to you. You may Google for that or turn to the discriminant analysis entry in the Wikipedia for an starting point for your search.

If you use R, you will find easy to use functions to carry out your analysis.

• +1 for the idea, although I don't think it's really appropriate. This answer implicitly assumes (as does the question, I will grant) that "likely to recycle" is a binary characteristic. It almost surely lies along a continuum, though: some people are more or less likely to recycle than others and being able to distinguish people along this continuum could be (very) useful. This argues for a regression-based approach rather than discriminant analysis or classification methods.
– whuber
Mar 8, 2013 at 15:31
• This is true. Much will depend on how much detail one has in the training sample. If one is able to distinguish many "levels" of "recycling attitude", certainly a regression approach would appear more adequate. Note, though, that discriminant analysis is not restricted to two groups, it could handle more if needed. Mar 8, 2013 at 22:12

A regression model is the perfect fit for your question. The simplest is the linear regression model which can be estimated with ordinary least squares, see the lm() method in R or the regress command in Matlab. Since the outcome (recycle or not) is binary, this is called a linear probability model. The coefficients on the predictor variables can be interpreted as the change in the expected probability of recycling.

Once you get familiar with the linear probability model you'll want to experiment with a generalized linear model such as logistic regression (logit model) or its near-equivalent, the probit model, see the glm command in R. Here the estimated coefficients are difficult to interpret so to best understand the estimates you'll need to look into marginal effects: Marginal effect of Probit and Logit model

• Great! I will look into it. Mar 9, 2013 at 11:03