跳转到内容

SQA Advanced Higher Statistics

Advanced Higher · SQAStatistics35 篇笔记 个文件夹,168 KB

cookie 制作的复习笔记,共 35 篇,分为 3 个章节,按照课程主题编排。

Notes for SQA Advanced Higher Statistics (C803 77), in folders for the course's three areas, data analysis and modelling, statistical inference and hypothesis testing, with one note per sub-topic in the specification's order. Each note has definitions, methods and worked examples. Delete any folder you do not need once the notes are yours.

内容

第一篇笔记

Data analysis and modelling / Exploratory data analysis of univariate data

Exploratory data analysis (EDA) is the first look at a set of data before any model is chosen. The aim is to see the shape of the data, its centre and spread, and any values that do not fit the pattern, so that later assumptions are reasonable.

Discrete and continuous data

A discrete variable takes values that can be counted, usually whole numbers, such as the number of goals scored in a match or the number of faulty bulbs in a box. A continuous variable can take any value in an interval and is measured, such as height, mass or time. The distinction matters because it decides which distributions can model the data. A Poisson or binomial model suits counts, and a normal model is often used for measurements.

Data are also collected in different ways. A survey, an experiment and a set of records from a machine can all give numbers, but they do not carry the same guarantees about how representative they are. EDA says nothing about whether the sample was chosen well; that depends on how the sample was drawn. What EDA can show is whether the sample looks like a sensible picture of the population it came from.

Displays for a single variable

A dot plot places one dot above a number line for each observation, so repeated values stack up. It works well for small sets of discrete data.

A stem-and-leaf diagram keeps the actual values while showing the shape. For the data 14, 17, 17, 21, 23, 23, 23, 28, the stems are the tens digits and the leaves are the units:

StemLeaves
14 7 7
21 3 3 3 8

A key such as "1 | 4 means 14" must go with the diagram. Leaves are written in order, so the diagram can be read to find the median and quartiles directly.

Summary measures

For a data set x1,x2,…,xnx_1, x_2, \ldots, x_n, the sample mean is

xˉ=1n∑i=1nxi. \bar{x} = \frac{1}{n}\sum_{i=1}^{n} x_i.

The median is the middle value when the data are in order. For an even number of values it is the average of the two middle values. The quartiles divide the ordered data into four equal parts. The lower quartile Q1Q_1 is the median of the lower half of the data and the upper quartile Q3Q_3 is the median of the upper half. Some textbooks include the median in both halves when nn is odd; it is left out of both halves here. Any consistent method gives the same conclusions in practice.

The interquartile range is IQR=Q3−Q1\text{IQR} = Q_3 - Q_1. It measures the spread of the middle half of the data and is not affected by a few extreme values.

Worked example

The twelve values 4, 6, 7, 9, 10, 11, 12, 12, 14, 15, 18, 31 are in order. The median is the average of the sixth and seventh values, (11+12)/2=11.5(11 + 12)/2 = 11.5. The lower half is 4, 6, 7, 9, 10, 11, with median (7+9)/2=8(7 + 9)/2 = 8, so Q1=8Q_1 = 8. The upper half is 12, 12, 14, 15, 18, 31, with median (14+15)/2=14.5(14 + 15)/2 = 14.5, so Q3=14.5Q_3 = 14.5. Then

IQR=14.5−8=6.5. \text{IQR} = 14.5 - 8 = 6.5.

The mean is 149/12=12.42149/12 = 12.42 to two decimal places, which is pulled upwards by the value 31. The median is 11.5, and the gap between the mean and the median is a sign that one value sits far from the rest.

The sample standard deviation divides by n−1n - 1 and is

s=1n−1∑i=1n(xi−xˉ)2. s = \sqrt{\frac{1}{n-1}\sum_{i=1}^{n}(x_i - \bar{x})^2}.

For this set s=7.05s = 7.05 to two decimal places. The divisor n−1n - 1 is explained in the section on estimators in statistical inference.

Box plots and outliers

A box plot draws a box from Q1Q_1 to Q3Q_3, a line at the median, and whiskers out to the most extreme values that are not outliers. Values beyond the fences are marked separately as possible outliers. The fences are

lower fence=Q1−1.5×IQR,upper fence=Q3+1.5×IQR. \text{lower fence} = Q_1 - 1.5 \times \text{IQR}, \qquad \text{upper fence} = Q_3 + 1.5 \times \text{IQR}.

The factor 1.5 is a common convention, not a law. A value beyond a fence is a possible outlier, meaning it is worth checking, not that it must be removed.

In the example above, the fences are 8−1.5×6.5=−1.758 - 1.5 \times 6.5 = -1.75 and 14.5+1.5×6.5=24.2514.5 + 1.5 \times 6.5 = 24.25. The value 31 lies beyond the upper fence, so it is a possible outlier. Nothing lies below the lower fence, and the only other value that might be questioned is the 4, which is well inside the fence.

Once a possible outlier is found, the response is a judgement, and it should be stated. A value that is a recording error can be corrected or removed, and the analysis should say so. A value that is genuine is kept, because removing it would make the data look more regular than they are. Either way, the conclusions should be given with and without the value where the decision matters.

Shape of the distribution

Two data sets can have the same mean and median and still look different. A histogram or a stem-and-leaf diagram shows whether the values pile up in the middle, spread evenly or cluster at one end. Describe the shape as symmetrical or non-symmetrical. A symmetrical distribution has its two halves as mirror images about the centre. Symmetry is not the same as normality: a normal distribution must be symmetrical, but a symmetrical distribution need not be normal, and a flat or bimodal set can be symmetrical without being bell-shaped. Describing the shape in words, such as "more values sit at the top end, with a long tail of low values", says the same thing more plainly.

Choosing a model after EDA

EDA is used to decide what to assume. A roughly symmetrical, bell-shaped set with no outliers suggests a normal model may fit. A set of whole-number counts that are spread out and have a mean close to their variance suggests a Poisson model. A set of two outcomes repeated a fixed number of times suggests a binomial model. These are suggestions to test, and the chi-squared goodness-of-fit test is the formal check that a chosen distribution fits the data.

When EDA shows an outlier that cannot be explained, the normal model may be a poor choice, and a method that does not assume normality is more appropriate. The Wilcoxon signed-rank and Mann-Whitney tests are the rank-based methods for that situation.

还有 34 个:可从上方列表中打开任意一个。

评论

还没有文字评价。把这些笔记添加到你自己的笔记中,就可以成为第一个评价的人。