K1, L4, 3.21 - Using technology to investigate real data

K1, L4, 3.21 - Using technology to investigate real data

Use the actual AQA car workbook to turn a real question into a reproducible investigation. You will preserve records when filtering and sampling, justify field-specific cleaning and use calculator or spreadsheet summaries to reach a careful contextual conclusion.

Turn a real question into an investigation

Can a small random sample have a higher mean CO2 than the whole group it came from, even when every calculation is right? We will follow real car records from the AQA workbook to find out.

Start with a question that sounds tempting: “Did newer cars cause lower carbon dioxide emissions?” The workbook records car characteristics; it did not randomly assign cars to years. A comparison can describe the recorded groups, but it cannot isolate registration year as a cause.

A useful descriptive question is: “Among FORD petrol cars with current keepers in the South West in this extract, how do recorded CO2 values compare between first-registration years 20022002 and 20162016?” This specifies a measured quantity, two groups and a defined eligible set.

You already know

The AQA workbook is a restricted 20172017 stock extract, with specified June registration weeks and matching manufacture years. PropulsionTypeId 11 means Petrol; CO2 is recorded carbon dioxide emission in g/km\mathrm{g/km}. A sample statistic need not equal its population parameter.

Choose the fields before pressing a calculator button. The response variable is CO2; the grouping variable is YearRegistered. Keep Make equal to FORD, PropulsionTypeId equal to 11 and GovRegion equal to South West. Those filters hold some characteristics fixed, while engine capacities and body types can still differ.

Statistical investigation cycle

Specify the question and population, collect suitable records, process and represent the data, then interpret and refine the question when the evidence reveals a limitation. With an existing workbook, collecting means obtaining the relevant records honestly, rather than choosing those that favour a preferred answer.

The cycle is not a button sequence with an inevitable conclusion. An unexpected value may send you back to the dictionary; a tiny filtered group may make the planned comparison unhelpful. Record those changes rather than quietly replacing the question after seeing the result.

Choose a representation that suits the variables. Separate plots on the same scale can compare CO2 in two year groups. A scatter plot is useful for two quantitative variables, such as EngineSize and CO2. The numerical codes for fuel categories do not form a meaningful measured horizontal axis. Later lessons develop displays and measures of spread in detail.

Key idea

State the response, comparison groups and eligible records before analysis. A narrower descriptive question can be answered honestly; a broad causal claim may require evidence the workbook does not contain.

The next options differ in how clearly they define a question and how far they extend the evidence.

Extract and sample without separating a record's fields

A reproducible extraction keeps the source, selection rules and record identifiers together.

Download the unchanged official workbook or raw CSV extraction. Read Introduction, Definition of fields and Field Values first. Work on an analysis copy and leave the source unchanged.

Apply all filters to the whole table, retaining ReferenceNumber. FORD, Petrol, South West and YearRegistered 20162016 gives 9595 eligible records. A filter can hide rows without removing them from an ordinary formula's calculation range. Copy the visible eligible records to a separate analysis range, or use an appropriate filtered-data function and verify its count. Do not assume that an AVERAGE over a whole column automatically uses only visible rows.

For a random sample, attach independent random helpers to eligible rows, freeze them as values, sort whole rows and take the required number. Resolve ties randomly. The workbook contains saved cached Random number values. Using those saved values, rather than newly recalculated random functions, reproduces the particular ordering used here.

The lowest six full-precision helpers in the 9595-record eligible group give the following authentic records. Helpers are rounded to six decimal places for display only; sorting used the full saved values.

ReferenceNumberSaved helper, displayedCO2 (g/km\mathrm{g/km})
212121210.0244220.024422159159
345934590.0307290.030729104104
368836880.0391850.039185138138
364236420.0505860.0505869999
197319730.0563180.056318125125
150515050.0721780.072178281281

Retain the full helpers and identifiers in your saved analysis. An emission list alone cannot establish which records were selected or whether the other filters were respected.

Worked example 1: reproducing a three-record selection

Question. Using the saved-helper ordering above, select three records from the 9595 eligible 20162016 FORD petrol/South West records. State their identifiers and CO2 values.

Plan. Sort complete eligible records by their full saved helpers and take the first three.

Selected identifiers=2121, 3459, 3688first three helper ranksAssociated CO2 values=159, 104, 138 g/kmkeep each value with its rown=3count selected records\begin{aligned} \text{Selected identifiers} &=2121,\ 3459,\ 3688 && \text{first three helper ranks}\\ \text{Associated CO2 values} &=159,\ 104,\ 138\,\mathrm{g/km} && \text{keep each value with its row}\\ n&=3 && \text{count selected records} \end{aligned}

Why this step? Sorting whole records preserves the relationship between each car's identifier, year, make and emission.

Answer. The selected pairs are (2121,159)(2121,159), (3459,104)(3459,104) and (3688,138)(3688,138), with CO2 in g/km\mathrm{g/km}.

Check. All three satisfy every filter and have different identifiers. They form a sample of three from 9595, not from every car in England.

Change only the requested sample size from three to six. Keep the filters and saved random ordering fixed.

Worked example 2: extending the same saved selection

Question. Select six records from the same eligible group, using the same saved-helper order.

Plan. Continue to the sixth distinct eligible row.

Selected identifiers=2121, 3459, 3688, 3642, 1973, 1505CO2 list=159, 104, 138, 99, 125, 281 g/kmn=6six complete records retained\begin{aligned} \text{Selected identifiers} &=2121,\ 3459,\ 3688,\ 3642,\ 1973,\ 1505\\ \text{CO2 list} &=159,\ 104,\ 138,\ 99,\ 125,\ 281\,\mathrm{g/km}\\ n&=6 && \text{six complete records retained} \end{aligned}

Why this step? Changing the sample size should not silently change the frame, filters or helper values as well.

Answer. Retain those six identified records and their full saved helpers.

Check. The first three records are unchanged and exactly three further eligible records have been added. The helper column itself is not a car measurement to summarise.

Freezing saves the selection after random generation; it does not make the sample represent excluded makes or regions.

Watch out

Wrong: “Sort only CO2 from low to high, leaving the other columns fixed.” This attaches one car's emission to another car's identity and destroys the records. Right: select and sort the whole table, keep identifiers, and freeze random helpers before saving a reproducible sample.

Try the same selection rule on a different authentic year group.

Clean the required field and report its denominator

Clean the field your question needs and report the number of usable values, rather than deleting every unusual row from every analysis.

Across the whole extract, 9292 Mass values are zero. Suspending these impossible masses leaves 3827−92=37353827-92=3735 positive masses for a provisional mass summary. A car with unusable Mass may still have usable CO2; its row should remain in the source and can remain eligible for another field.

These four genuine records were deliberately chosen to show data-quality issues. They are not a random sample and cannot estimate how common those issues are. “Blank” means an empty source cell.

ReferenceNumberFuelEngineSize (cm3\mathrm{cm}^3)Mass (kg\mathrm{kg})CO2 (g/km\mathrm{g/km})NOX (g/km\mathrm{g/km})
588588Petrol2979297900230230Blank
36453645Electric001270127000Blank
937937Petrol1198119811321132000.0420.042
14651465Petrol13981398116311631181180.0100.010

Mass here includes the dictionary's 75 kg75\,\mathrm{kg} average-driver allowance. The following calculation concerns that recorded Mass, so no allowance is subtracted.

Worked example 3: a provisional mass summary

Question. Calculate a provisional mean of the four diagnostic records' Mass values, excluding the impossible zero. State the denominator.

Plan. Flag record 588588's Mass as unusable and average the other three masses.

nusable=3one impossible mass suspendedMass total=1270+1132+1163=3565 kgretain positive massesMean Mass=35653≈1188.3 kgone decimal place\begin{aligned} n_{\text{usable}} &=3 && \text{one impossible mass suspended}\\ \text{Mass total} &=1270+1132+1163=3565\,\mathrm{kg} && \text{retain positive masses}\\ \text{Mean Mass} &=\frac{3565}{3}\approx1188.3\,\mathrm{kg} && \text{one decimal place} \end{aligned}

Why this step? Zero Mass cannot be a car's mass, but it is still a stored source value. Exclude it explicitly from this calculation rather than replacing it with a guessed value.

Answer. The provisional mean is 1188.3 kg1188.3\,\mathrm{kg}, using three recorded masses.

Check. Including the impossible zero would give 3565/4=891.25 kg3565/4=891.25\,\mathrm{kg}. The exclusion changes the denominator as well as the interpretation.

Change only the analysed field from Mass to CO2 for the same four records. The appropriate exclusions now change because zero means something different in this field.

Worked example 4: the same records, a different field

Question. Calculate a provisional mean recorded CO2 for the same diagnostic records. Retain the electric car's zero direct exhaust CO2, but suspend the questionable petrol zero at record 937937, pending source clarification.

Plan. Follow the stated field-specific rule and use the three remaining CO2 entries.

nusable=3petrol zero suspendedCO2 total=230+0+118=348electric zero retainedMean CO2=3483=116 g/kmrecorded emission rate\begin{aligned} n_{\text{usable}} &=3 && \text{petrol zero suspended}\\ \text{CO2 total} &=230+0+118=348 && \text{electric zero retained}\\ \text{Mean CO2} &=\frac{348}{3}=116\,\mathrm{g/km} && \text{recorded emission rate} \end{aligned}

Why this step? Record 588588's unusable Mass does not invalidate its recorded CO2, and the electric car's zero CO2 has a plausible direct-exhaust meaning.

Answer. The provisional mean recorded CO2 is 116 g/km116\,\mathrm{g/km}, using three entries under the stated rule. This is not a confirmed correction of record 937937.

Check. Deleting every row with any zero would discard the electric car and record 588588, even though both contribute usable CO2 under this rule.

Blank NOX is not zero NOX. Here there are two recorded entries and two blanks, so a recorded-value NOX mean needs denominator two. If missingness is associated with car type, that mean may fail to represent all four cars.

The particulate dictionary says diesel-only, while the workbook contains some petrol rows with particulate entries. Preserve that discrepancy for checking. An unusually high emission is also not automatically an error: inspect the identified car before deciding whether an exclusion is justified. Mean calculations use a recall result, not a supplied formula-booklet formula.

Watch out

Wrong: “The blanks count as zero, so divide by four.” That invents two zero measurements. Right: distinguish unavailable cells from recorded zeros, state which field and values are used, and report the usable count.

Use the same records to check how a third field changes the denominator.

Continue this lesson.

You’re previewing NovaLearn without an account. Create a free account to read the rest.

Create free account