1. Hello Data

Math 115

Yurk

What is Data?

Data are observations or measurements collected to understand the world around us.

Why study data?

  • Make informed decisions based on evidence
  • Understand patterns and relationships
  • Draw conclusions beyond what we directly observe

Our approach: We’ll learn using real-world examples, starting with loan data from peer-to-peer lending.

Meet Our Dataset: loan50

Context:

  • Source: Lending Club (major peer-to-peer lending platform)
  • Data: 50 randomly selected loans from the platform

We’ll use this dataset throughout to explore fundamental data concepts.

Data Frames

Statistical data is organized in data frames - rectangular tables with rows and columns.

The loan50 dataset (first 6 loans)
loan_amount interest_rate term grade state total_income homeownership
22000 10.90 60 B NJ 59000 rent
6000 9.92 36 B CA 60000 rent
25000 26.30 36 E SC 75000 mortgage
6000 9.92 36 B CA 75000 rent
25000 9.43 60 B OH 254000 mortgage
6400 9.92 36 B IN 67000 mortgage

This rectangular structure is universal across statistical software and analysis.

Cases and Variables

In our loan50 data frame:

  • Each row = one case (or observational unit)
    • Our cases: individual loans (we have 50 cases)
  • Each column = one variable (a measured characteristic)
    • Our variables: loan_amount, interest_rate, term, grade, state, total_income, homeownership (7 variables)

Summary Statistics

A summary statistic is a single number summarizing data from a sample.

  • Mean loan amount in our data: $17,083.00

Summary statistics can reveal patterns:

Credit Grade Mean Interest Rate (%)
A 6.8
B 10.2
C 13.8
D 18.6
E 25.6

Variable Types: Two Main Categories

Numerical variables - values are numbers where arithmetic operations make sense

  • Examples from loan50: loan_amount, interest_rate, term

Categorical variables - values indicate different levels or categories

  • Examples from loan50: grade, state, homeownership

Variable Type Subdivisions

Numerical variables:

  • Discrete: specific values with jumps between them
    • Example: term (36 or 60 months, nothing in between)
  • Continuous: any value in a range
    • Example: loan_amount (could be $5,000, $5,001, etc.)

Categorical variables:

  • Ordinal: levels have natural ordering
    • Example: grade (A is better than B, B better than C, etc.)
  • Nominal: no natural ordering
    • Example: state (Michigan vs Ohio vs Texas)

Variable classification diagram. From IMS2 Figure 1.1.

Classifying loan50 Variables

Practice: How would you classify each variable in our dataset?

Variable Type
loan_amount numerical, continuous
interest_rate numerical, continuous
term numerical, discrete
grade categorical, ordinal
state categorical, nominal
total_income numerical, continuous
homeownership categorical, nominal

Population vs. Sample

Population: The complete group we want to study

  • All loans ever made through Lending Club

Sample: A subset of the population we actually observe

  • Our 50 loans in the loan50 dataset

Census vs. Survey

Two approaches to studying a population:

Census: Examine every case in the population (ALL loans)

  • Complete information, but often impractical
  • Time-consuming, expensive, sometimes impossible

Survey: Examine a sample from the population (loan50 dataset)

  • Practical and efficient
  • Use sample data to make inferences about the population

Parameter vs. Statistic

Parameter: A numerical value describing the population (what we want to know)

  • The true mean interest rate for ALL Lending Club loans
  • Usually unknown - we can’t measure it

Statistic: A numerical value calculated from our sample (what we can measure)

  • The mean interest rate in our 50 loans
  • Serves as our estimate of the parameter

Identifying Parameters and Statistics

Using loan50:

  • Statistic: Mean loan amount = $17,083.00 (calculated from our 50 loans)
  • Parameter: True mean loan amount for all Lending Club loans (unknown, but we estimate it using our statistic)

Another example: Mean height of all Hope students (parameter) vs. mean height in sample of 30 students (statistic)

Caution - Anecdotal Evidence:

  • “My friend got a 5% interest rate” is anecdotal (one person’s story)
  • We need systematic data collection from proper samples
  • Don’t base conclusions on individual experiences or haphazard observations

References