Attribute type | Description | Examples | Operations |
---|---|---|---|
Nominal | Nominal values provide only enough information to distinguish one object from another. (=, β ) | Zip codes, employee ID numbers, eye color, gender | Mode, entropy, contingency correlation, chi2 test |
Ordinal | The values of an ordinal attribute provide enough information to order objects. (<, >) | Hardness of minerals, {good, better, best}, grades, street numbers | Quantiles, rank correlation |
Interval | Differences between values are meaningful, i.e., a unit of measurement exists. (+, -) | Calendar dates, temperature in Celsius or Fahrenheit | mean, standard deviation, Pearson's correlation |
Ratio | For ratio variables, both differences and ratios are meaningful. (*, /) | Temperature in Kelvin, monetary quantities, counts, age, mass, length, electrical current | Geometric mean, harmonic mean, percent variation |
Statistics in R
Readings and class materials for Tuesday, September 12, 2023
Objectives of Statistical Analysis in Economics
Statistical analysis serves as an information-compressing mechanism. The primary objectives can be broadly categorized into:
Predictive Tasks
These tasks aim to forecast future outcomes based on historical data and current conditions.
Descriptive Tasks
These tasks focus on summarizing the main aspects of the data to provide an informative overview.
Exploratory Analysis
This involves identifying patterns, relationships, or anomalies in the data without a prior hypothesis.
Confirmatory Analysis
This involves testing predefined hypotheses to confirm or refute them.
Types of Data
Classification Based on Structure
Unstructured Data
Data that does not have a predefined format or organization.
Structured Data
Data that is organized in a specific manner, often in tabular form.
Types of Structured Data
Cross-sectional
Time-series
Longitudinal
Spatial
Network
The type of data dictates the statistical tools and techniques that can be employed for analysis.
Attribute Types
Different types of attributes require different statistical techniques for effective analysis.
Quality of Data
Common Issues
Missing data
Outliers
Duplication
Inconsistent data
Some examples
Let us examine a sample data from the modeldata R package.
# load the data
data(attrition, package = "modeldata")
tibble(attrition)
# A tibble: 1,470 Γ 31
Age Attrition BusinessTravel DailyRate Department DistanceFromHome
<int> <fct> <fct> <int> <fct> <int>
1 41 Yes Travel_Rarely 1102 Sales 1
2 49 No Travel_Frequently 279 Research_Develo⦠8
3 37 Yes Travel_Rarely 1373 Research_Develo⦠2
4 33 No Travel_Frequently 1392 Research_Develo⦠3
5 27 No Travel_Rarely 591 Research_Develo⦠2
6 32 No Travel_Frequently 1005 Research_Develo⦠2
7 59 No Travel_Rarely 1324 Research_Develo⦠3
8 30 No Travel_Rarely 1358 Research_Develo⦠24
9 38 No Travel_Frequently 216 Research_Develo⦠23
10 36 No Travel_Rarely 1299 Research_Develo⦠27
# βΉ 1,460 more rows
# βΉ 25 more variables: Education <ord>, EducationField <fct>,
# EnvironmentSatisfaction <ord>, Gender <fct>, HourlyRate <int>,
# JobInvolvement <ord>, JobLevel <int>, JobRole <fct>, JobSatisfaction <ord>,
# MaritalStatus <fct>, MonthlyIncome <int>, MonthlyRate <int>,
# NumCompaniesWorked <int>, OverTime <fct>, PercentSalaryHike <int>,
# PerformanceRating <ord>, RelationshipSatisfaction <ord>, β¦
After loading data that we would like to work with, it is worthwhile to examine and create descriptive statistics. The summary
function exists in almost every language, but in R, I suggest using a dedicated package for this purpose: skmir
(although there are countless others available).
attrition |>
skimr::skim()
Name | attrition |
Number of rows | 1470 |
Number of columns | 31 |
_______________________ | |
Column type frequency: | |
factor | 15 |
numeric | 16 |
________________________ | |
Group variables | None |
Variable type: factor
skim_variable | n_missing | complete_rate | ordered | n_unique | top_counts |
---|---|---|---|---|---|
Attrition | 0 | 1 | FALSE | 2 | No: 1233, Yes: 237 |
BusinessTravel | 0 | 1 | FALSE | 3 | Tra: 1043, Tra: 277, Non: 150 |
Department | 0 | 1 | FALSE | 3 | Res: 961, Sal: 446, Hum: 63 |
Education | 0 | 1 | TRUE | 5 | Bac: 572, Mas: 398, Col: 282, Bel: 170 |
EducationField | 0 | 1 | FALSE | 6 | Lif: 606, Med: 464, Mar: 159, Tec: 132 |
EnvironmentSatisfaction | 0 | 1 | TRUE | 4 | Hig: 453, Ver: 446, Med: 287, Low: 284 |
Gender | 0 | 1 | FALSE | 2 | Mal: 882, Fem: 588 |
JobInvolvement | 0 | 1 | TRUE | 4 | Hig: 868, Med: 375, Ver: 144, Low: 83 |
JobRole | 0 | 1 | FALSE | 9 | Sal: 326, Res: 292, Lab: 259, Man: 145 |
JobSatisfaction | 0 | 1 | TRUE | 4 | Ver: 459, Hig: 442, Low: 289, Med: 280 |
MaritalStatus | 0 | 1 | FALSE | 3 | Mar: 673, Sin: 470, Div: 327 |
OverTime | 0 | 1 | FALSE | 2 | No: 1054, Yes: 416 |
PerformanceRating | 0 | 1 | TRUE | 2 | Exc: 1244, Out: 226, Low: 0, Goo: 0 |
RelationshipSatisfaction | 0 | 1 | TRUE | 4 | Hig: 459, Ver: 432, Med: 303, Low: 276 |
WorkLifeBalance | 0 | 1 | TRUE | 4 | Bet: 893, Goo: 344, Bes: 153, Bad: 80 |
Variable type: numeric
skim_variable | n_missing | complete_rate | mean | sd | p0 | p25 | p50 | p75 | p100 | hist |
---|---|---|---|---|---|---|---|---|---|---|
Age | 0 | 1 | 36.92 | 9.14 | 18 | 30 | 36.0 | 43.00 | 60 | βββββ |
DailyRate | 0 | 1 | 802.49 | 403.51 | 102 | 465 | 802.0 | 1157.00 | 1499 | βββββ |
DistanceFromHome | 0 | 1 | 9.19 | 8.11 | 1 | 2 | 7.0 | 14.00 | 29 | ββ βββ |
HourlyRate | 0 | 1 | 65.89 | 20.33 | 30 | 48 | 66.0 | 83.75 | 100 | βββββ |
JobLevel | 0 | 1 | 2.06 | 1.11 | 1 | 1 | 2.0 | 3.00 | 5 | βββββ |
MonthlyIncome | 0 | 1 | 6502.93 | 4707.96 | 1009 | 2911 | 4919.0 | 8379.00 | 19999 | ββ βββ |
MonthlyRate | 0 | 1 | 14313.10 | 7117.79 | 2094 | 8047 | 14235.5 | 20461.50 | 26999 | βββββ |
NumCompaniesWorked | 0 | 1 | 2.69 | 2.50 | 0 | 1 | 2.0 | 4.00 | 9 | βββββ |
PercentSalaryHike | 0 | 1 | 15.21 | 3.66 | 11 | 12 | 14.0 | 18.00 | 25 | ββ βββ |
StockOptionLevel | 0 | 1 | 0.79 | 0.85 | 0 | 0 | 1.0 | 1.00 | 3 | βββββ |
TotalWorkingYears | 0 | 1 | 11.28 | 7.78 | 0 | 6 | 10.0 | 15.00 | 40 | βββββ |
TrainingTimesLastYear | 0 | 1 | 2.80 | 1.29 | 0 | 2 | 3.0 | 3.00 | 6 | βββββ |
YearsAtCompany | 0 | 1 | 7.01 | 6.13 | 0 | 3 | 5.0 | 9.00 | 40 | βββββ |
YearsInCurrentRole | 0 | 1 | 4.23 | 3.62 | 0 | 2 | 3.0 | 7.00 | 18 | βββββ |
YearsSinceLastPromotion | 0 | 1 | 2.19 | 3.22 | 0 | 0 | 1.0 | 3.00 | 15 | βββββ |
YearsWithCurrManager | 0 | 1 | 4.12 | 3.57 | 0 | 2 | 3.0 | 7.00 | 17 | βββ ββ |
American Trends Panel Wave 110
Source: Pew Research Center.
haven::read_sav("../data/ATP W110.sav") |> # .. = root folder
skimr::skim()
Name | haven::read_sav(β../data/β¦ |
Number of rows | 6174 |
Number of columns | 175 |
_______________________ | |
Column type frequency: | |
numeric | 173 |
POSIXct | 2 |
________________________ | |
Group variables | None |
Variable type: numeric
skim_variable | n_missing | complete_rate | mean | sd | p0 | p25 | p50 | p75 | p100 | hist |
---|---|---|---|---|---|---|---|---|---|---|
QKEY | 0 | 1.00 | 1.774274e+11 | 6.583185e+10 | 100314 | 2.01801e+11 | 2.018011e+11 | 2.019011e+11 | 2.02101e+11 | βββββ |
DEVICE_TYPE_W110 | 0 | 1.00 | 1.730000e+00 | 5.200000e-01 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 3.00000e+00 | βββββ |
LANG_W110 | 0 | 1.00 | 1.070000e+00 | 2.600000e-01 | 1 | 1.00000e+00 | 1.000000e+00 | 1.000000e+00 | 2.00000e+00 | βββββ |
FORM_W110 | 0 | 1.00 | 1.500000e+00 | 5.000000e-01 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 2.00000e+00 | βββββ |
XCITIZEN_W110 | 0 | 1.00 | 1.330000e+00 | 5.140000e+00 | 1 | 1.00000e+00 | 1.000000e+00 | 1.000000e+00 | 9.90000e+01 | βββββ |
POL1JB_W110 | 0 | 1.00 | 2.930000e+00 | 1.129000e+01 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
POL1JBSTR_W110 | 84 | 0.99 | 2.870000e+00 | 1.205000e+01 | 1 | 1.00000e+00 | 1.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
INSTFAV_a_W110 | 0 | 1.00 | 4.210000e+00 | 1.124000e+01 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
INSTFAV_b_W110 | 0 | 1.00 | 3.980000e+00 | 1.079000e+01 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
JBCONF_ECON_W110 | 0 | 1.00 | 3.270000e+00 | 6.310000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
JBCONF_CRIS_W110 | 0 | 1.00 | 3.250000e+00 | 6.780000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
JBCONF_IMMI_W110 | 3089 | 0.50 | 3.280000e+00 | 6.550000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
JBCONF_CLSR_W110 | 3089 | 0.50 | 3.500000e+00 | 6.510000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
JBCONF_CN_W110 | 3089 | 0.50 | 3.560000e+00 | 8.340000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
JBCONF_CONG_W110 | 3085 | 0.50 | 3.330000e+00 | 6.970000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
JBCONF_CRIM_W110 | 3085 | 0.50 | 3.370000e+00 | 7.190000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
JBCONF_PUBH_W110 | 3085 | 0.50 | 3.090000e+00 | 7.220000e+00 | 1 | 2.00000e+00 | 2.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
JBECON_W110 | 0 | 1.00 | 3.270000e+00 | 1.012000e+01 | 1 | 2.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
JBADMIN2_NRCH_W110 | 0 | 1.00 | 3.890000e+00 | 1.067000e+01 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
JBADMIN2_OPEN_W110 | 0 | 1.00 | 3.380000e+00 | 8.350000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
JBADMIN2_EFFI_W110 | 0 | 1.00 | 3.720000e+00 | 8.490000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
JBADMIN2_STND_W110 | 0 | 1.00 | 3.360000e+00 | 7.810000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
JBADMIN2_MORL_W110 | 0 | 1.00 | 3.380000e+00 | 8.630000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
DIFFPARTY_W110 | 0 | 1.00 | 2.000000e+00 | 7.140000e+00 | 1 | 1.00000e+00 | 1.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
PTYISSUE_ECON_W110 | 0 | 1.00 | 3.990000e+00 | 1.013000e+01 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
PTYISSUE_ABPOL_W110 | 0 | 1.00 | 4.140000e+00 | 9.100000e+00 | 1 | 2.00000e+00 | 4.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
PTYISSUE_IMM_W110 | 3089 | 0.50 | 3.600000e+00 | 8.030000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
PTYISSUE_COV_W110 | 3089 | 0.50 | 4.660000e+00 | 1.117000e+01 | 1 | 2.00000e+00 | 4.000000e+00 | 5.000000e+00 | 9.90000e+01 | βββββ |
PTYISSUE_CLIM_W110 | 3089 | 0.50 | 4.620000e+00 | 1.090000e+01 | 1 | 2.00000e+00 | 4.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
PTYISSUE_LGT_W110 | 3089 | 0.50 | 4.720000e+00 | 1.089000e+01 | 1 | 3.00000e+00 | 4.000000e+00 | 5.000000e+00 | 9.90000e+01 | βββββ |
PTYISSUE_GUNS_W110 | 3085 | 0.50 | 3.730000e+00 | 7.820000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
PTYISSUE_HC_W110 | 3085 | 0.50 | 4.470000e+00 | 1.049000e+01 | 1 | 2.00000e+00 | 4.000000e+00 | 5.000000e+00 | 9.90000e+01 | βββββ |
PTYISSUE_RACE_W110 | 3085 | 0.50 | 4.760000e+00 | 1.141000e+01 | 1 | 2.00000e+00 | 4.000000e+00 | 5.000000e+00 | 9.90000e+01 | βββββ |
PTYISSUE_CRIME_W110 | 3085 | 0.50 | 4.330000e+00 | 1.108000e+01 | 1 | 2.00000e+00 | 3.000000e+00 | 5.000000e+00 | 9.90000e+01 | βββββ |
REPPTYTRAIT_EXTR_W110 | 3089 | 0.50 | 3.820000e+00 | 1.263000e+01 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
REPPTYTRAIT_EXCHT_W110 | 3085 | 0.50 | 4.220000e+00 | 1.405000e+01 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
REPPTYTRAIT_HON_W110 | 0 | 1.00 | 4.080000e+00 | 1.064000e+01 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
REPPTYTRAIT_TOL_W110 | 0 | 1.00 | 4.210000e+00 | 1.138000e+01 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
REPPTYTRAIT_TRADS_W110 | 0 | 1.00 | 3.980000e+00 | 1.121000e+01 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
REPPTYTRAIT_INTF_W110 | 0 | 1.00 | 4.260000e+00 | 1.327000e+01 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
DEMPTYTRAIT_EXTR_W110 | 3089 | 0.50 | 3.550000e+00 | 1.085000e+01 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
DEMPTYTRAIT_EXCHT_W110 | 3085 | 0.50 | 4.460000e+00 | 1.390000e+01 | 1 | 1.00000e+00 | 3.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
DEMPTYTRAIT_HON_W110 | 0 | 1.00 | 3.760000e+00 | 1.010000e+01 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
DEMPTYTRAIT_TOL_W110 | 0 | 1.00 | 3.590000e+00 | 1.099000e+01 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
DEMPTYTRAIT_TRADS_W110 | 0 | 1.00 | 3.760000e+00 | 1.110000e+01 | 1 | 2.00000e+00 | 2.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
DEMPTYTRAIT_INTF_W110 | 0 | 1.00 | 3.930000e+00 | 1.224000e+01 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
TRAITREPa_W110 | 0 | 1.00 | 4.810000e+00 | 1.256000e+01 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
TRAITREPb_W110 | 0 | 1.00 | 4.220000e+00 | 1.176000e+01 | 1 | 2.00000e+00 | 3.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
TRAITREPc_W110 | 0 | 1.00 | 5.000000e+00 | 1.169000e+01 | 1 | 3.00000e+00 | 4.000000e+00 | 5.000000e+00 | 9.90000e+01 | βββββ |
TRAITREPe_W110 | 0 | 1.00 | 4.730000e+00 | 1.232000e+01 | 1 | 3.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
TRAITREPf_W110 | 0 | 1.00 | 4.640000e+00 | 1.140000e+01 | 1 | 3.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
TRAITDEMa_W110 | 0 | 1.00 | 4.700000e+00 | 1.209000e+01 | 1 | 3.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
TRAITDEMb_W110 | 0 | 1.00 | 4.690000e+00 | 1.202000e+01 | 1 | 3.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
TRAITDEMc_W110 | 0 | 1.00 | 4.210000e+00 | 1.135000e+01 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
TRAITDEMe_W110 | 0 | 1.00 | 4.670000e+00 | 1.257000e+01 | 1 | 3.00000e+00 | 3.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
TRAITDEMf_W110 | 0 | 1.00 | 4.740000e+00 | 1.221000e+01 | 1 | 3.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
SENGUN22A_W110 | 0 | 1.00 | 2.050000e+00 | 4.150000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
SENGUN22B_W110 | 0 | 1.00 | 2.510000e+00 | 4.470000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
SENGUN22C_W110 | 0 | 1.00 | 3.020000e+00 | 6.980000e+00 | 1 | 2.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
SENGUN22D_W110 | 0 | 1.00 | 2.870000e+00 | 1.215000e+01 | 1 | 1.00000e+00 | 1.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
ABRTLGL_W110 | 0 | 1.00 | 3.700000e+00 | 1.220000e+01 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
ECON1_W110 | 0 | 1.00 | 3.620000e+00 | 5.210000e+00 | 1 | 3.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
ECON1B_W110 | 0 | 1.00 | 2.680000e+00 | 7.710000e+00 | 1 | 2.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
PERSFNC_W110 | 0 | 1.00 | 3.070000e+00 | 6.530000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
PERSFNCB_W110 | 0 | 1.00 | 2.640000e+00 | 7.010000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
ECONCONC_INFL_W110 | 0 | 1.00 | 1.520000e+00 | 4.840000e+00 | 1 | 1.00000e+00 | 1.000000e+00 | 1.000000e+00 | 9.90000e+01 | βββββ |
ECONCONC_UNEM_W110 | 0 | 1.00 | 2.590000e+00 | 6.100000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
ECONCONC_LAB_W110 | 0 | 1.00 | 2.320000e+00 | 5.980000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
ECONCONC_ENG_W110 | 0 | 1.00 | 1.540000e+00 | 5.000000e+00 | 1 | 1.00000e+00 | 1.000000e+00 | 1.000000e+00 | 9.90000e+01 | βββββ |
ECONCONC_SHTG_W110 | 0 | 1.00 | 2.100000e+00 | 6.100000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
ECONCONC_REAL_W110 | 0 | 1.00 | 1.780000e+00 | 5.020000e+00 | 1 | 1.00000e+00 | 1.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
ECONCONC_STCK_W110 | 0 | 1.00 | 2.730000e+00 | 8.210000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
INFROLE_GOVSP_W110 | 0 | 1.00 | 2.770000e+00 | 8.570000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
INFROLE_COVID_W110 | 0 | 1.00 | 2.150000e+00 | 6.810000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
INFROLE_PROF_W110 | 0 | 1.00 | 2.460000e+00 | 8.410000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
INFROLE_UKR_W110 | 0 | 1.00 | 2.520000e+00 | 7.940000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
INFROLE_INTRT_W110 | 0 | 1.00 | 3.350000e+00 | 1.106000e+01 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
PARTY_GOOD_W110 | 3089 | 0.50 | 3.820000e+00 | 1.161000e+01 | 1 | 2.00000e+00 | 3.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
VIEWSCHAR_W110 | 3085 | 0.50 | 3.110000e+00 | 1.316000e+01 | 1 | 1.00000e+00 | 1.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
FAVPOL_BIDEN_W110 | 0 | 1.00 | 3.640000e+00 | 9.190000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
FAVPOL_TRUMP_W110 | 0 | 1.00 | 3.760000e+00 | 8.590000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
FAVPOL_HARRIS_W110 | 3089 | 0.50 | 4.070000e+00 | 1.094000e+01 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
FAVPOL_SCHUMER_W110 | 3089 | 0.50 | 5.620000e+00 | 1.469000e+01 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
FAVPOL_MCCONNELL_W110 | 3089 | 0.50 | 5.850000e+00 | 1.504000e+01 | 1 | 3.00000e+00 | 4.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
FAVPOL_PELOSI_W110 | 3085 | 0.50 | 4.450000e+00 | 1.180000e+01 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
FAVPOL_MCCARTHY_W110 | 3085 | 0.50 | 6.230000e+00 | 1.537000e+01 | 1 | 3.00000e+00 | 4.000000e+00 | 5.000000e+00 | 9.90000e+01 | βββββ |
FAVPOL_PENCE_W110 | 3085 | 0.50 | 4.480000e+00 | 1.265000e+01 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
RGHTCNTRL_W110 | 0 | 1.00 | 2.680000e+00 | 1.040000e+01 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
MOREGUNIMPACT_W110 | 3089 | 0.50 | 3.090000e+00 | 1.075000e+01 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
MASSSTRICT_W110 | 3085 | 0.50 | 2.610000e+00 | 8.410000e+00 | 1 | 1.00000e+00 | 1.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
ELCTCOLLB_W110 | 0 | 1.00 | 3.310000e+00 | 1.365000e+01 | 1 | 1.00000e+00 | 1.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
CANMTCHPOL_W110 | 0 | 1.00 | 2.950000e+00 | 1.221000e+01 | 1 | 1.00000e+00 | 1.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
LEADERCHAR_WIN_W110 | 0 | 1.00 | 3.360000e+00 | 1.070000e+01 | 1 | 1.00000e+00 | 1.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
LEADERCHAR_DSA_W110 | 0 | 1.00 | 4.360000e+00 | 1.350000e+01 | 1 | 1.00000e+00 | 3.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
LEADERCHAR_MIL_W110 | 0 | 1.00 | 4.850000e+00 | 1.076000e+01 | 1 | 3.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
LEADERCHAR_GVEXP_W110 | 0 | 1.00 | 3.950000e+00 | 1.095000e+01 | 1 | 2.00000e+00 | 3.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
PRTY_CHSE_W110 | 0 | 1.00 | 3.890000e+00 | 1.019000e+01 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
REPLEAD_EVIL_W110 | 3089 | 0.50 | 2.970000e+00 | 9.590000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
REPLEAD_COOP_W110 | 3089 | 0.50 | 2.680000e+00 | 9.120000e+00 | 1 | 1.00000e+00 | 1.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
REPLEAD_DMGD_W110 | 3089 | 0.50 | 4.580000e+00 | 9.730000e+00 | 1 | 3.00000e+00 | 4.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
DEMLEAD_EVIL_W110 | 3085 | 0.50 | 3.490000e+00 | 1.167000e+01 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
DEMLEAD_COOP_W110 | 3085 | 0.50 | 3.000000e+00 | 1.076000e+01 | 1 | 1.00000e+00 | 1.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
DEMLEAD_RPGD_W110 | 3085 | 0.50 | 5.000000e+00 | 1.135000e+01 | 1 | 3.00000e+00 | 4.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
HRD_ABRTN_W110 | 0 | 1.00 | 1.760000e+00 | 5.980000e+00 | 1 | 1.00000e+00 | 1.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
ABRTN_SCOTUS_W110 | 0 | 1.00 | 4.090000e+00 | 1.128000e+01 | 1 | 1.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
PARTY_W110 | 0 | 1.00 | 3.480000e+00 | 1.064000e+01 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
PARTYLN_W110 | 3437 | 0.44 | 9.480000e+00 | 2.667000e+01 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
PARTYSTR_W110 | 2737 | 0.56 | 1.790000e+00 | 6.670000e+00 | 1 | 1.00000e+00 | 1.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYREP_a_W110 | 4623 | 0.25 | 1.610000e+00 | 6.090000e+00 | 1 | 1.00000e+00 | 1.000000e+00 | 1.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYREP_b_W110 | 4623 | 0.25 | 1.730000e+00 | 6.580000e+00 | 1 | 1.00000e+00 | 1.000000e+00 | 1.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYREP_c_W110 | 4623 | 0.25 | 1.960000e+00 | 4.340000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYREP_f_W110 | 4623 | 0.25 | 2.700000e+00 | 4.300000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYREP_g_W110 | 4623 | 0.25 | 2.010000e+00 | 6.570000e+00 | 1 | 1.00000e+00 | 1.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYDEM_a_W110 | 4288 | 0.31 | 2.040000e+00 | 8.100000e+00 | 1 | 1.00000e+00 | 1.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYDEM_b_W110 | 4288 | 0.31 | 2.120000e+00 | 8.100000e+00 | 1 | 1.00000e+00 | 1.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYDEM_c_W110 | 4288 | 0.31 | 2.300000e+00 | 7.450000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYDEM_f_W110 | 4288 | 0.31 | 2.800000e+00 | 5.920000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYDEM_g_W110 | 4288 | 0.31 | 2.080000e+00 | 7.110000e+00 | 1 | 1.00000e+00 | 1.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYLN1R_a_W110 | 5020 | 0.19 | 2.280000e+00 | 7.590000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYLN1R_b_W110 | 5020 | 0.19 | 2.060000e+00 | 7.050000e+00 | 1 | 1.00000e+00 | 1.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYLN1R_c_W110 | 5020 | 0.19 | 2.950000e+00 | 9.020000e+00 | 1 | 2.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYLN1R_g_W110 | 5020 | 0.19 | 3.070000e+00 | 9.870000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYLN2R_a_W110 | 5020 | 0.19 | 2.890000e+00 | 9.460000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYLN2R_b_W110 | 5020 | 0.19 | 2.610000e+00 | 8.590000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYLN2R_c_W110 | 5020 | 0.19 | 3.020000e+00 | 8.060000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYLN2R_e_W110 | 5020 | 0.19 | 2.540000e+00 | 8.590000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYLN1D_a_W110 | 4814 | 0.22 | 2.240000e+00 | 5.920000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYLN1D_b_W110 | 4814 | 0.22 | 1.930000e+00 | 5.950000e+00 | 1 | 1.00000e+00 | 1.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYLN1D_c_W110 | 4814 | 0.22 | 2.530000e+00 | 6.470000e+00 | 1 | 2.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYLN1D_g_W110 | 4814 | 0.22 | 2.590000e+00 | 7.460000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYLN2D_a_W110 | 4814 | 0.22 | 2.550000e+00 | 7.910000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYLN2D_b_W110 | 4814 | 0.22 | 2.500000e+00 | 7.920000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYLN2D_c_W110 | 4814 | 0.22 | 2.970000e+00 | 7.430000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
IDENTITYLN2D_e_W110 | 4814 | 0.22 | 2.740000e+00 | 9.500000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
DVOTER_W110 | 3161 | 0.49 | 3.780000e+00 | 6.100000e+00 | 1 | 3.00000e+00 | 4.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
RVOTER_W110 | 3577 | 0.42 | 3.900000e+00 | 6.270000e+00 | 1 | 3.00000e+00 | 4.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
E3MOD_W110 | 0 | 1.00 | 3.510000e+00 | 7.700000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 5.000000e+00 | 9.90000e+01 | βββββ |
YRSJOB_W110 | 2908 | 0.53 | 2.710000e+00 | 3.540000e+00 | 1 | 2.00000e+00 | 2.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
YRSJOBSLF_W110 | 5656 | 0.08 | 3.240000e+00 | 6.060000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
LOOKLKLY_W110 | 2390 | 0.61 | 4.090000e+00 | 5.540000e+00 | 1 | 3.00000e+00 | 4.000000e+00 | 5.000000e+00 | 9.90000e+01 | βββββ |
JOBSEC_W110 | 2390 | 0.61 | 2.730000e+00 | 7.450000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
FINDJOB_W110 | 2390 | 0.61 | 3.270000e+00 | 5.080000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
ABRTN_STATE_W110 | 0 | 1.00 | 2.650000e+00 | 1.220000e+00 | 1 | 1.00000e+00 | 3.000000e+00 | 4.000000e+00 | 4.00000e+00 | ββ βββ |
F_METRO | 0 | 1.00 | 1.110000e+00 | 3.200000e-01 | 1 | 1.00000e+00 | 1.000000e+00 | 1.000000e+00 | 2.00000e+00 | βββββ |
F_CREGION | 0 | 1.00 | 2.720000e+00 | 9.800000e-01 | 1 | 2.00000e+00 | 3.000000e+00 | 3.000000e+00 | 4.00000e+00 | βββββ |
F_CDIVISION | 0 | 1.00 | 5.290000e+00 | 2.410000e+00 | 1 | 3.00000e+00 | 5.000000e+00 | 7.000000e+00 | 9.00000e+00 | β ββββ |
F_AGECAT | 0 | 1.00 | 2.970000e+00 | 5.560000e+00 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
F_GENDER | 0 | 1.00 | 1.790000e+00 | 4.490000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
F_EDUCCAT | 0 | 1.00 | 2.090000e+00 | 5.300000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
F_EDUCCAT2 | 0 | 1.00 | 4.170000e+00 | 5.370000e+00 | 1 | 2.00000e+00 | 4.000000e+00 | 5.000000e+00 | 9.90000e+01 | βββββ |
F_HISP | 0 | 1.00 | 2.140000e+00 | 5.940000e+00 | 1 | 2.00000e+00 | 2.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
F_HISP_ORIGIN | 4779 | 0.23 | 1.484000e+01 | 3.081000e+01 | 1 | 1.00000e+00 | 3.000000e+00 | 8.000000e+00 | 9.90000e+01 | βββββ |
F_YEARSINUS | 0 | 1.00 | 1.990000e+00 | 7.180000e+00 | 1 | 1.00000e+00 | 1.000000e+00 | 1.000000e+00 | 9.90000e+01 | βββββ |
F_RACECMB | 0 | 1.00 | 3.570000e+00 | 1.376000e+01 | 1 | 1.00000e+00 | 1.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
F_RACETHNMOD | 0 | 1.00 | 3.130000e+00 | 1.084000e+01 | 1 | 1.00000e+00 | 1.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
F_CITIZEN | 0 | 1.00 | 1.330000e+00 | 5.140000e+00 | 1 | 1.00000e+00 | 1.000000e+00 | 1.000000e+00 | 9.90000e+01 | βββββ |
F_BIRTHPLACE | 0 | 1.00 | 2.030000e+00 | 6.760000e+00 | 1 | 1.00000e+00 | 1.000000e+00 | 1.000000e+00 | 9.90000e+01 | βββββ |
F_MARITAL | 0 | 1.00 | 2.960000e+00 | 6.660000e+00 | 1 | 1.00000e+00 | 1.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
F_RELIG | 0 | 1.00 | 5.120000e+00 | 8.800000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 1.000000e+01 | 9.90000e+01 | βββββ |
F_BORN | 2072 | 0.66 | 3.490000e+00 | 1.357000e+01 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
F_RELIGCAT1 | 0 | 1.00 | 2.660000e+00 | 7.850000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
F_ATTEND | 0 | 1.00 | 4.470000e+00 | 6.250000e+00 | 1 | 2.00000e+00 | 5.000000e+00 | 6.000000e+00 | 9.90000e+01 | βββββ |
F_PARTY_FINAL | 0 | 1.00 | 3.480000e+00 | 1.064000e+01 | 1 | 1.00000e+00 | 2.000000e+00 | 3.000000e+00 | 9.90000e+01 | βββββ |
F_PARTYLN_FINAL | 3437 | 0.44 | 9.480000e+00 | 2.667000e+01 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
F_PARTYSUM_FINAL | 0 | 1.00 | 1.810000e+00 | 1.470000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 9.00000e+00 | βββββ |
F_PARTYSUMIDEO_FINAL | 0 | 1.00 | 2.800000e+00 | 1.790000e+00 | 1 | 1.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.00000e+00 | βββββ |
F_INC_SDT1 | 0 | 1.00 | 8.680000e+00 | 1.884000e+01 | 1 | 2.00000e+00 | 5.000000e+00 | 9.000000e+00 | 9.90000e+01 | βββββ |
F_REG | 372 | 0.94 | 1.670000e+00 | 6.180000e+00 | 1 | 1.00000e+00 | 1.000000e+00 | 1.000000e+00 | 9.90000e+01 | βββββ |
F_IDEO | 0 | 1.00 | 4.940000e+00 | 1.389000e+01 | 1 | 2.00000e+00 | 3.000000e+00 | 4.000000e+00 | 9.90000e+01 | βββββ |
F_INTFREQ | 166 | 0.97 | 1.820000e+00 | 3.860000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
F_VOLSUM | 0 | 1.00 | 1.850000e+00 | 3.940000e+00 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
F_INC_TIER2 | 0 | 1.00 | 6.740000e+00 | 2.112000e+01 | 1 | 1.00000e+00 | 2.000000e+00 | 2.000000e+00 | 9.90000e+01 | βββββ |
WEIGHT_W110 | 0 | 1.00 | 1.000000e+00 | 1.030000e+00 | 0 | 3.80000e-01 | 7.100000e-01 | 1.240000e+00 | 6.13000e+00 | βββββ |
Variable type: POSIXct
skim_variable | n_missing | complete_rate | min | max | median | n_unique |
---|---|---|---|---|---|---|
INTERVIEW_START_W110 | 0 | 1 | 2022-06-27 17:00:53 | 2022-07-04 22:56:53 | 2022-06-29 08:34:32 | 5867 |
INTERVIEW_END_W110 | 0 | 1 | 2022-06-27 17:15:36 | 2022-07-04 23:14:28 | 2022-06-29 10:29:48 | 5924 |
Measures of Central Tendency π¦
Arithmetic Mean
The arithmetic mean is calculated as:
\[\bar{Y}=\frac{Y_1+Y_2+\ldots+Y_N}{N}=\frac{\sum_{i=1}^N Y_i}{N}\]
Geometric Mean
The geometric mean is calculated as:
\[\bar{Y}_g=\sqrt[N]{\prod_{i=1}^N Y_i}\]
Example
The average can also be interpreted as meaning that if all elements were replaced by this value, the sum of the elements would remain the same.
Let us see the case of indexes:
The GDP growth in one year was 5 percent and 5 percent in the following and 10 percent in the 3rd.
What was the annual growth in the 3 years?
\[1.05 \times 1.05 \times 1.10 = \sqrt[3]{1.21}=1.0656\]
However, the arithmetic mean equals 20/3 = 6.66.
Harmonic Mean
The harmonic mean is calculated as:
\[\bar{Y}_h=\frac{N}{\sum_{i=1}^N \frac{1}{Y_i}}\]
Example
Consider two car owners who seek to reduce their costs:
Adam switches from a gas-guzzler of 12 mpg to a slightly less voracious guzzler that runs at 14 mpg.
The environmentally virtuous Beth switches from a Bon ss es from 30 mpg car to one that runs at 40 mpg.
Suppose both drivers travel equal distances over a year. Who will save more gas by switching?
Squared Mean
The squared mean is calculated as:
\[\bar{Y_q}=\sqrt{\frac{\sum_{i=1}^N Y_i^2}{N}}\]
Quantiles
Quantiles are values that divide a dataset into equal groups. The types of quantiles include:
# Groups | NAME |
---|---|
2 | Median |
3 | Tertiles |
4 | Quartiles |
5 | Quintiles |
10 | Deciles |
20 | Ventiles |
100 | Percentiles |
There will often be occasions when you need to reproduce a complete study or methodology for research or any other purpose. Generally, itβs not possible, and even the calculation of quantiles prevents precise reproduction, as everyone considers it completely obvious how to calculate the median or a quartile (and the choosen method is never documented). However, depending on the chosen methodology, we will obtain a very minimal but still different result.
x <- c(231, 45342, 2313, 213, 564, 874543, 92713, 3941, 31297, 2654, 4324, 6542) # random numbers
Measures of Variability
Standard Deviation
Standard deviation is the average difference between the observations and the mean??
It was already mentioned that the sum of the deviations from the average is zero. If we divide zero by the number of observations it is still zeroβ¦
Here comes the squared mean!
\[\sigma=\sqrt{\frac{\sum_{i=1}^N\left(Y_i-\bar{Y}\right)^2}{N}}\]
Variance
Variance is simply the square of standard deviation.
\[\sigma^2=\frac{\sum_{i=1}^N\left(Y_i-\bar{Y}\right)^2}{N}\]
In many cases, we often use variance instead of standard deviation and not just for fun. If we recall what we learned about the ANOVA, variances are additive, while standard deviations are not.
Range
The spread of your data from the lowest to the highest value.
Interquartile range (IQR)
\[\text{IQR}=Q_3-Q1\]
Interdecile range (IDR)
\[\text{IDR}=D_9-D1\]
Boxplot
boxplot(attrition$MonthlyIncome)
The boxplot is highly popular for describing a variable, as it displays numerous variables and effectively illustrates the differences based on a categorical feature (but we will discuss this further when we get there).