Variable Types
Variable Types
Variables are often specified according to their type and intended use. Be careful when referring to a variable; don't confuse the variable with values it may take on. In the examples below I'll attempt to describe this common error.
the numbers, we still may order the responses. Awful is "worse than" Poor; Poor is worse than OK; OK is worse than Good; Good is worse than Great. A natural ordering exists for these categories. Contrast this with a categorical variable such as hair color. There is no natural ordering for the various colors of hair.. Math 158 students do not worry much about ordinal variables. They treat them as if they were categorical variables. However, in advance statistics ordinal variables are treated differently to make use of the added structure they give to a variable.
Example
Consider a study performed by a medical center to determine which of two heart surgeries is most effective: angioplasty (running rubber tubes through the arteries) or bypass (rerouting arteries). The purpose of either procedure is to prolong the life of the patient. The study will certainly record the survival time of each patient (measured from the time of the surgery). This really is the outcome of the study; survival time is the response variable. Now, each patient will get one of the two types of operations; this is a second variable. . .let's call it the "procedure" variable; it takes one of two possible values, Angioplasty and Bypass. The entire purpose of the study is to determine how, if at all, the procedure affects survival time. Type of surgery is an explanatory variable. We would use type of operation (explanatory variable or predictor) to predict survival time (response or predicted variable). Survival time may well depend on procedure; survival time is the dependent variable and procedure is the independent variable. Note that the response is measured after the explanatory. This is often---but not always---the case. The response variable is quantitative, the explanatory variable is categorical. In a true clinical trial many more explanatory variables would be recorded: gender, age at the time of surgery, state of health pre-surgery (how would this be measured?), numerous physiological indicators and so forth. There would be but one response variable, survival time! (Actually, there would be others. Quality of life after the operation is important, as is an analysis of the side-effects attributable to the two procedures.)