Data Frames
Statistical data is organized in data frames — rectangular tables with rows and columns.
The loan50 dataset (first 6 loans)
| 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.
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