This short video contains an overview of calculating conditional percentages.

The original slides are not available.

This document is linked from Case C-C.

]]>This document is linked from One Categorical Variable.

]]>- Examples of Variables
- Definition and Examples of Categorical and Quantitative Variables

- Definitions and Examples of Sub-Classifications
- Categorical into Nominal or Ordinal
- Quantitative into Discrete or Continuous

- A quick but complete review of the examples and definitions in Parts A and B
- An optional discussion on Time to Event data (survival data).
- An example dataset from a heart attack study. Its variables are classified as Categorical or Quantitative as additional practice.

This document is linked from Types of Variables.

**Future Edits: Add captions to YouTube videos from transcript text

]]>Variables can be broadly classified into one of two **types**:

- Quantitative

- Categorical

Below we define these two main types of variables and provide further sub-classifications for each type.

**Categorical variables** take **category** or **label** values, and place an individual into one of several **groups**.

Categorical variables are often further classified as either:

**Nominal,**when there**is no natural ordering among the categories**.

Common examples would be gender, eye color, or ethnicity.

**Ordinal**, when there**is a natural order among the categories**, such as, ranking scales or letter grades.

However, ordinal variables are still categorical and do not provide precise measurements.

Differences are not precisely meaningful, for example, if one student scores an A and another a B on an assignment, we cannot say precisely the difference in their scores, only that an A is larger than a B.

**Quantitative variables** take **numerical** values, and represent some kind of **measurement**.

Quantitative variables are often further classified as either:

**Discrete**, when the variable takes on a**countable**number of values.

Most often these variables indeed represent some kind of **count** such as the number of prescriptions an individual takes daily.

**Continuous**, when the variable**can take on any value in some range of values**.

Our precision in measuring these variables is often limited by our instruments.

Units should be provided.

Common examples would be height (inches), weight (pounds), or time to recovery (days).

One special variable type occurs when a variable has only two possible values.

A variable is said to be** Binary **or **Dichotomous**, when there are only two possible levels.

These variables can usually be phrased in a “yes/no” question. Gender is an example of a binary variable.

Currently we are primarily concerned with classifying variables as either categorical or quantitative.

Sometimes, however, we will need to consider further and sub-classify these variables as defined above.

These concepts will be discussed and reviewed as needed but here is a quick practice on sub-classifying categorical and quantitative variables.

Let’s revisit the dataset showing medical records for a sample of patients

In our example of medical records, there are several variables of each type:

- Age, Weight, and Height are
**quantitative**variables.

- Race, Gender, and Smoking are
**categorical**variables.

** Comments:**

- Notice that the values of the
**categorical**variable Smoking have been**coded**as the numbers 0 or 1.

It is quite common to code the values of a categorical variable as numbers, but you should remember that these are just codes.

They have no arithmetic meaning (i.e., it does not make sense to add, subtract, multiply, divide, or compare the magnitude of such values).

Usually, if such a coding is used, all categorical variables will be coded and we will tend to do this type of coding for datasets in this course.

- Sometimes,
**quantitative**variables are**divided into groups**for analysis, in such a situation, although the original variable was quantitative, the variable analyzed is categorical.

A common example is to provide information about an individual’s Body Mass Index by stating whether the individual is underweight, normal, overweight, or obese.

This categorized BMI is an example of an ordinal categorical variable.

**Categorical**variables are sometimes called qualitative variables, but in this course we’ll use the term “categorical.”

The **types of variables** you are analyzing **directly relate to the available** descriptive and inferential **statistical methods**.

It is important to:

**assess how you will measure the effect of interest**and**know how this determines the statistical methods you can use.**

As we proceed in this course, we will continually emphasize the **types of variables** that are** appropriate for each method we discuss**.

For example:

To compare the number of polio cases in the two treatment arms of the Salk Polio vaccine trial, you could use

- Fisher’s Exact Test
- Chi-Square Test

To compare blood pressures in a clinical trial evaluating two blood pressure-lowering medications, you could use

- Two-sample t-Test
- Wilcoxon Rank-Sum Test

For each scenario, identify the variable as either **quantitative** or **categorical**.

This document is linked from Proportions (Introduction & Step 1).

]]>Optional: Create your own solutions using your software for extra practice.

In this activity, we will use the collected data to:

- build a two-way table and compute conditional percentages.
- interpret the data in terms of the relationship between a young child’s nighttime exposure to light and later nearsightedness.

An Associated Press article captured the attention of readers with the headline “Night lights bad for kids?” The article was based on a 1999 study at the University of Pennsylvania and Children’s Hospital of Philadelphia, in which parents were surveyed about the lighting conditions under which their children slept between birth and age 2 (lamp, night-light, or no light) and whether or not their children developed nearsightedness (myopia). The purpose of the study was to explore the effect of a young child’s nighttime exposure to light on later nearsightedness.

nightlight.xls or nightlight.csv

**Create Two-Way tables:**ANALYZE > DESCRIPTIVE STATISTICS > CROSSTABS, complete the wizard (4 times) to obtain- Two-way table with the count (frequency) and percent (out of total)
- Two-way table with the count (frequency) and row percents
- Two-way table with the count (frequency) and column percents
- Two-way table with the count (frequency), row and column percents

**Create Two-Way tables:**Use PROC FREQ and the tables statement to create a two-way table with light and nearsightedness

This document is linked from Case C-C.

The following tables are used in the next question.

The United States federal government collects information on Americans who do not have health insurance. Data from 2004 are broken down into 4 regions of the country. These data are summarized in the table provided below. Using this table, answer the following questions.

Answer these questions:

This document is linked from Case C-C.

]]>This document is linked from Case C-C.

]]>This document is linked from Case C-C.

]]>

This document is linked from Case C-C.

]]>