Chapter page 36 / 3827 Applications: Model and infer
English

27  Applications: Model and infer

27.1 Case study: Mario Kart

In this case study, we consider Ebay auctions of a video game called Mario Kart for the Nintendo Wii. The outcome variable of interest is the total price of an auction, which is the highest bid plus the shipping cost. We will try to determine how total price is related to each characteristic in an auction while simultaneously controlling for other variables. For instance, all other characteristics held constant, are longer auctions associated with higher or lower prices? And, on average, how much more do buyers tend to pay for additional Wii wheels (plastic steering wheels that attach to the Wii controller) in auctions? Multiple regression will help us answer these and other questions.

The mariokart data can be found in the openintro R package.

The mariokart dataset includes results from 141 auctions. Four observations from this dataset are shown in Table 27.1, and descriptions for each variable are shown in Table 27.2. Notice that the condition and stock photo variables are indicator variables, similar to bankruptcy in the loans dataset from Chapter 25.

Table 27.1: Top four rows of the mariokart dataset.
price cond_new stock_photo duration wheels
51.5 new yes 3 1
37.0 used yes 7 1
45.5 new no 3 1
44.0 new yes 3 1
Table 27.2: Variables and their descriptions for the mariokart dataset.
Variable Description
price Final auction price plus shipping costs, in US dollars.
cond_new Indicator variable for if the game is new (1) or used (0).
stock_photo Indicator variable for if the auction's main photo is a stock photo.
duration The length of the auction, in days, taking values from 1 to 10.
wheels The number of Wii wheels included with the auction. A Wii wheel is an optional steering wheel accessory that holds the Wii controller.

27.1.1 Mathematical approach to linear models

In Table 27.3 we fit a mathematical linear regression model with the game’s condition as a predictor of auction price.

\[E[\texttt{price}] = \beta_0 + \beta_1\times \texttt{cond\_new}\]

Results of the model are summarized below:

Table 27.3: Summary of a linear model for predicting price based on cond_new.
term estimate std.error statistic p.value
(Intercept) 42.9 0.81 52.67 <0.0001
cond_new 10.9 1.26 8.66 <0.0001

Write down the equation for the model, note whether the slope is statistically different from zero, and interpret the coefficient.1

Sometimes there are underlying structures or relationships between predictor variables. For instance, new games sold on Ebay tend to come with more Wii wheels, which may have led to higher prices for those auctions. We would like to fit a model that includes all potentially important variables simultaneously, which would help us evaluate the relationship between a predictor variable and the outcome while controlling for the potential influence of other variables.

We want to construct a model that accounts for not only the game condition but simultaneously accounts for three other variables:

\[ E[\texttt{price}] = \beta_0 + \beta_1 \times \texttt{cond\_new} + \beta_2\times \texttt{stock\_photo} + \beta_3 \times \texttt{duration} + \beta_4 \times \texttt{wheels} \]

Table 27.4 summarizes the full model. Using the output, we identify the point estimates of each coefficient and the corresponding impact (measured with information on the standard error used to compute the p-value).

Table 27.4: Summary of a linear model for predicting price based on cond_new, stock_photo, duration, and wheels.
term estimate std.error statistic p.value
(Intercept) 36.21 1.51 23.92 <0.0001
cond_new 5.13 1.05 4.88 <0.0001
stock_photo 1.08 1.06 1.02 0.3085
duration -0.03 0.19 -0.14 0.8882
wheels 7.29 0.55 13.13 <0.0001

Write out the model’s equation using the point estimates from Table 27.4. How many predictors are there in the model? How many coefficients are estimated?2

What does \(\beta_4,\) the coefficient of variable \(x_4\) (Wii wheels), represent? What is the point estimate of \(\beta_4?\)3

Compute the residual of the first observation in Table 27.1 using the equation identified in Table 27.4.4

In Table 27.3, we estimated a coefficient for cond_new in of \(b_1 = 10.90\) with a standard error of \(SE_{b_1} = 1.26\) when using simple linear regression. Why might there be a difference between that estimate and the one in the multiple regression setting?


If we examined the data carefully, we would see that there is multicollinearity among some predictors. For instance, when we estimated the connection of the outcome price and predictor cond_new using simple linear regression, we were unable to control for other variables like the number of Wii wheels included in the auction. That model was biased by the confounding variable wheels. When we use both variables, this particular underlying and unintentional bias is reduced or eliminated (though bias from other confounding variables may still remain).

27.1.2 Computational approach to linear models

Previously, using a mathematical model, we investigated the coefficients associated with cond_new when predicting price in a linear model.

Estimated slopes from linear models (of price regressed on cond_new) built on 1,000 randomized datasets. Each dataset was permuted under the null hypothesis. The randomized slopes range from about -5 to +5, and the observed slope value is 10.9 which is not near the distribution of randomized slopes.
Figure 27.1: Estimated slopes from linear models (price regressed on cond_new) built on 1,000 randomized datasets. Each dataset was permuted under the null hypothesis.

In Figure 27.1, the red line (the observed slope) is far from the bulk of the histogram. Explain why the randomly permuted datasets produce slopes that are quite different from the observed slope.


The null hypothesis is that, in the population, there is no linear relationship between the price and the cond_new of the Mario Kart games. When the data are randomly permuted, prices are randomly assigned to a condition (new or used), so that the null hypothesis is forced to be true, i.e., permutation is done under the assumption that no relationship between the two variables exists. In the actual study, the new Mario Kart games do actually cost more (on average) than the used games! So the slope describing the actual observed relationship is not one that is likely to have happened in a randomly dataset permuted under the assumption that the null hypothesis is true.

Using the histogram in Figure 27.1, find the p-value and conclude the hypothesis test in the context of the problem.5

Is the conclusion based on the histogram of randomized slopes consistent with the conclusion obtained using the mathematical model? Explain.6

Although knowing there is a relationship between the condition of the game and its price, we might be more interested in the difference in price, here given by the slope of the linear regression line. That is, \(\beta_1\) represents the population value for the difference in price between new Mario Kart games and used games.

Estimated slopes from linear models (of price regressed on cond new) built on 1,000 bootstrapped datasets. Each bootstrap sample was taken from the original Mario Kart auction data. The histogram of the boostrapped slopes is bell-shaped, symmetric, and centered around the observed value of 10.9.
Figure 27.2: Estimated slopes from linear models (price regressed on cond_new) built on 1,000 bootstrapped datasets. Each bootstrap sample was taken from the original Mario Kart auction data.

Figure 27.2 displays the slope estimates taken from bootstrap samples of the original data. Using the histogram, estimate the standard error of the slope. Is your estimate similar to the value of the standard error of the slope provided in the output of the mathematical linear model?


The slopes seem to vary from approximately 8 to 14. Using the empirical rule, we know that if a variable has a bell-shaped distribution, most of the observations will be with 2 standard errors of the center. Therefore, a rough approximation of the standard error is 1.5. The standard error given in Table 27.3 is 1.26 which is not too different from the value computed using the bootstrap approach.

Use Figure 27.2 to create a 90% standard error bootstrap confidence interval for the true slope. Interpret the interval in context.7

Use Figure 27.2 to create a 90% bootstrap percentile confidence interval for the true slope. Interpret the interval in context.8

27.1.3 Cross-validation

In Chapter 8, models were compared using \(R^2_{adj}.\) In Chapter 25, however, a computational approach was introduced to compare models by removing chunks of data one at a time and assessing how well the variables predicted the observations that had been held out.

Figure 27.3 was created by cross-validating models with the same variables as in Table 27.3 and Table 27.4. We applied 3-fold cross-validation, so 1/3 of the data was removed while 2/3 of the observations were used to build each model (first on cond_new only and then on cond_new, stock_photo, duration, and wheels). Note that each time 1/3 of the data is removed, the resulting model will produce slightly different model coefficients.

The points in Figure 27.3 represent the prediction (x-axis) and residual (y-axis) for each observation run through the cross-validated model. In other words, the model is built (using the other 2/3) without the observation (which is in the 1/3) being used. The residuals give us a sense for how well the model will do at predicting observations which were not a part of the original dataset, e.g., future studies.

Cross-validation predictions and errors from linear models built on two different sets of variables. Left regressed price on cond new; right regressed price on cond new, stock photo, duration, and wheels. For each of the two models, the x-axis plots the predicted value and the y-axis plots the prediction error. More variables lead to smaller prediction errors.
(a) price vs. cond_new
Cross-validation predictions and errors from linear models built on two different sets of variables. Left regressed price on cond new; right regressed price on cond new, stock photo, duration, and wheels. For each of the two models, the x-axis plots the predicted value and the y-axis plots the prediction error. More variables lead to smaller prediction errors.
(b) price vs. cond_new, stock_photo, duration, and wheels
Figure 27.3: Cross-validation predictions and errors from linear models built on two different sets of variables.

In Figure 27.3 (b), note the point at roughly predicted = 50 and prediction error = 10. Estimate the observed and predicted value for that observation.9

In Figure 27.3 (b), for the same point at roughly predicted = 50 and prediction error = 10, describe which cross-validation fold(s) were used to build its prediction model.10

By noting the spread of the cross-validated prediction errors (on the y-axis) in Figure 27.3, which model should be chosen for a final report on these data?11

Using the summary statistic cross-validation sum of squared errors (CV SSE), which model should be chosen for a final report on these data?12

27.2 Interactive R tutorials

Navigate the concepts you’ve learned in this part in R using the following self-paced tutorials. All you need is your browser to get started!

You can also access the full list of tutorials supporting this book here.

27.3 R labs

Further apply the concepts you’ve learned in this part in R with computational labs that walk you through a data analysis case study.

You can also access the full list of labs supporting this book here.


  1. The equation for the line may be written as \(\widehat{\texttt{price}} = 47.15 + 10.90\times \texttt{cond\_new}\). Examining the regression output in Table 27.3 we can see that the p-value for cond_new is very close to zero, indicating there is strong evidence that the coefficient is different from zero when using this one-variable model. The variable cond_new is a two-level categorical variable that takes value 1 when the game is new and value 0 when the game is used. This means the 10.90 model coefficient predicts a price of an extra $10.90 for those games that are new versus those that are used.↩︎

  2. \(\widehat{\texttt{price}} = 36.21 + 5.13 \times \texttt{cond\_new} + 1.08 \times \texttt{stock\_photo} - 0.03 \times \texttt{duration} + 7.29 \times \texttt{wheels},\) with 4 predictors but 5 coefficients (including the intercept).↩︎

  3. In the population of all auctions, it is the average difference in auction price for each additional Wii wheel included when holding the other variables constant. The point estimate is \(b_4 = 7.29\)↩︎

  4. \(e_i = y_i - \hat{y_i} = 51.55 - 49.62 = 1.93\).↩︎

  5. The observed slope is 10.9 which is nowhere near the range of values for the permuted slopes (roughly -5 to +5). Because the observed slope is not a plausible value under the null distribution, the p-value is essentially zero. We reject the null hypothesis and claim that there is a relationship between whether the game is new (or not) and the average predicted price of the game.↩︎

  6. The p-value in Table 27.3 is also essentially zero, so the null hypothesis is also rejected when the mathematical model approach is taken. Often, the mathematical and computational approaches to inference will give quite similar answers.↩︎

  7. Using the bootstrap SE method, we know the normal percentile is \(z^\star = 1.645\), which gives a CI of \(b_1 \pm 1.645 \cdot SE \rightarrow 10.9 \pm 1.645 \cdot 1.5 \rightarrow (8.43, 13.37).\) For games that are new, the average price is higher by between $8.43 and $13.37 than games that are used, with 90% confidence.↩︎

  8. Because there were 1,000 bootstrap resamples, we look for the cutoffs which provide 50 bootstrap slopes on the left, 900 in the middle, and 50 on the right. Looking at the bootstrap histogram, the rough 90% confidence interval is $9 to $13.10. For games that are new, the average price is higher by between $9.00 and $13.10 than games that are used, with 90% confidence.↩︎

  9. The predicted value is roughly \(\widehat{\texttt{price}} = \$50.\) The observed value is roughly \(\texttt{price}_i = \$60\) riders (using \(e_i = y_i - \hat{y}_i).\)↩︎

  10. The point appears to be in fold 2, so folds 1 and 3 were used to build the prediction model.↩︎

  11. The cross-validated residuals on cond_new vary roughly from -15 to 15, while the cross-validated residuals on the four predictor model vary less, roughly from -10 to 10. Given the smaller residuals from the four predictor model, it seems as though the larger model is better.↩︎

  12. The CV SSE is smaller (by a factor of almost two!) for the model with four predictors. Using a single valued criterion (CV SSE) allows us to make a decision to choose the model with four predictors.↩︎

中文

27  应用:建模与推断

27.1 案例研究:马里奥赛车

在本案例研究中,我们考察一款名为 马力卡丁车 的任天堂Wii电子游戏在eBay上的拍卖。我们关注的结果变量是拍卖的总价格,即最高出价加上运费。我们将尝试确定总价格与拍卖中每个特征之间的关系,同时控制其他变量。例如,在其他所有特征保持不变的情况下,拍卖时间较长是与更高还是更低的价格相关?此外,买家平均愿意为额外的Wii方向盘(连接到Wii手柄上的塑料方向盘)多支付多少钱?多元回归将帮助我们回答这些以及其他问题。

mariokart 数据可以在 openintro R 包中找到。

mariokart 数据集包含141次拍卖的结果。该数据集中的四个观测值显示在 表 27.1中,每个变量的描述显示在 表 27.2中。请注意,condition(成色)和stock photo(实物照片)变量是 指示变量,类似于 bankruptcy 的 IQR,在 loans 数据集来自 第 25 章.

表 27.1: mariokart 数据集的最后五行。
的前四行数据 price (Intercept) cond_new stock_photo duration
51.5 new yes 3 1
37.0 used yes 7 1
45.5 new (数学课上有时会讲授)是数据集中出现次数最多的值。然而,对于许多真实世界的数据集,数据集中常常 3 1
44.0 new yes 3 1
表 27.2:变量及其描述,用于 mariokart 数据集的最后五行。
变量 描述
的前四行数据 price 最终拍卖价格加运费,以美元计。
(Intercept) 指示变量,表示游戏是全新的(1)还是二手的(0)。
cond_new 指示变量,表示拍卖的主图是否为库存图片。
stock_photo 拍卖的时长(以天为单位),取值范围为1到10。
duration 拍卖中包含的Wii方向盘数量。Wii方向盘是一种可选的方向盘配件,用于放置Wii控制器。

27.1.1 线性模型的数学方法

表 27.3 我们拟合了一个数学线性回归模型,以游戏的新旧状况作为拍卖价格的预测变量。

\[E[\texttt{price}] = \beta_0 + \beta_1\times \texttt{cond\_new}\]

模型结果总结如下:

Table 27.3: 基于 price 预测 cond_new.
term 估计 的线性模型摘要 统计量 std.error
p.value 42.9 0.81 52.67 <0.0001
(Intercept) 10.9 1.26 8.66 <0.0001

cond_new1

有时预测变量之间存在潜在的结构或关系。例如,在 Ebay 上出售的新游戏往往附带更多的 Wii 方向盘,这可能导致这些拍卖的价格更高。我们希望拟合一个同时包含所有潜在重要变量的模型,这将有助于我们在控制其他变量潜在影响的同时,评估某个预测变量与结果之间的关系。

我们想构建一个模型,不仅考虑游戏状况,还同时考虑其他三个变量:

\[ E[\texttt{price}] = \beta_0 + \beta_1 \times \texttt{cond\_new} + \beta_2\times \texttt{stock\_photo} + \beta_3 \times \texttt{duration} + \beta_4 \times \texttt{wheels} \]

表 27.4 总结了完整模型。利用该输出,我们确定每个系数的点估计值及其相应的影响(用用于计算 p 值的标准误信息来衡量)。

表 27.4:基于 price 预测 cond_new, stock_photo, durationwheels.
term 估计 的线性模型摘要 统计量 std.error
p.value 36.21 1.51 23.92 <0.0001
(Intercept) 5.13 1.05 4.88 <0.0001
cond_new 1.08 1.06 1.02 0.3085
stock_photo -0.03 0.19 -0.14 0.8882
duration 7.29 0.55 13.13 <0.0001

wheels 表 27.4使用2

中的点估计值写出模型的方程。模型中有多少个预测变量?估计了多少个系数? \(\beta_4,\) 变量 的系数 \(x_4\) (Wii 方向盘)代表什么?它的点估计是多少? \(\beta_4?\)3

计算 表 27.1 中第一个观测值的残差,使用在 表 27.4.4

表 27.3中确定的方程。 cond_new 中,我们估计了 \(b_1 = 10.90\) 的一个系数,为 \(SE_{b_1} = 1.26\) ,其标准误为


(使用简单线性回归时)。为什么该估计值与多元回归中的估计值可能存在差异? 如果我们仔细检查数据,会发现某些预测变量之间存在 多重共线性 price 。例如,当我们用简单线性回归估计结果变量 cond_new 与预测变量 wheels的关系时,我们无法控制其他变量,比如拍卖中包含的 Wii 方向盘数量。该模型受到了混杂变量

27.1.2 的偏倚影响。当我们同时使用这两个变量时,这种潜在的、无意的偏倚就会被减少或消除(尽管来自其他混杂变量的偏倚可能仍然存在)。

线性模型的计算方法 cond_new 之前,我们使用数学模型研究了在预测 price 在线性模型中。

Estimated slopes from linear models (of price regressed on cond_new) built on 1,000 randomized datasets. Each dataset was permuted under the null hypothesis. The randomized slopes range from about -5 to +5, and the observed slope value is 10.9 which is not near the distribution of randomized slopes.
图 27.1:基于 1,000 个随机化数据集的线性模型(price 为响应变量, cond_new进行回归)估计得到的斜率。每个数据集都是在原假设下进行置换得到的。

图 27.1,红线(观测到的斜率)远离直方图的主体部分。请解释为什么随机置换的数据集产生的斜率与观测到的斜率差异很大。


原假设是:在总体中, pricecond_new ,针对 马力卡丁车 游戏的价格之间不存在线性关系。当数据被随机置换时,价格被随机分配到某一条件(全新或二手),从而使原假设被强制成立,也就是说,置换是在假设两个变量之间不存在关系的前提下进行的。而在实际研究中,全新的 马力卡丁车 游戏确实(平均而言)比二手游戏更贵!因此,描述实际观测到的关系的斜率,在原假设为真的前提下随机置换数据集时是不太可能出现的。

利用 图 27.1中的直方图,求出 p 值,并结合问题的实际背景对假设检验作出结论。5

基于随机化斜率直方图得出的结论与使用数学模型得到的结论是否一致?请解释。6

尽管我们已经知道游戏的新旧状况与其价格之间存在关系,但我们可能更关心价格的差异,这里由线性回归直线的斜率给出。也就是说, \(\beta_1\) 表示全新的 马力卡丁车 游戏和二手游戏。

Estimated slopes from linear models (of price regressed on cond new) built on 1,000 bootstrapped datasets. Each bootstrap sample was taken from the original Mario Kart auction data. The histogram of the boostrapped slopes is bell-shaped, symmetric, and centered around the observed value of 10.9.
图 27.2:基于 1,000 个自助抽样数据集的线性模型(以price 为响应变量, cond_new为自变量)估计的斜率。每个自助样本均取自原始的马里奥赛车拍卖数据。

图 27.2 展示了从原始数据的自助样本中得到的斜率估计值。利用直方图,估计斜率的标准误。你的估计与数学线性模型输出中给出的斜率标准误是否相近?


斜率似乎在约 8 到 14 之间变化。根据经验法则,我们知道如果一个变量呈钟形分布,大多数观测值将位于中心 2 个标准误的范围内。因此,标准误的粗略近似值为 1.5。 表 27.3 中给出的标准误为 1.26,与使用自助法计算出的值相差不大。

使用 图 27.2 为真实斜率构建一个 90% 的标准误自助置信区间。结合具体情境解释该区间。7

使用 图 27.2 为真实斜率构建一个 90% 的自助百分位置信区间。结合具体情境解释该区间。8

27.1.3 交叉验证

第 8 章中,模型是通过 \(R^2_{adj}.\)第 25 章中,然而,介绍了一种计算方法来比较模型,即每次移除一部分数据,并评估变量对被保留(留出)观测值的预测效果。

图 27.3 是通过与 表 27.3表 27.4中具有相同变量的模型进行交叉验证得到的。我们采用了 3 折交叉验证,即移除 1/3 的数据,而使用 2/3 的观测值来构建每个模型(首先在 cond_new 仅且然后于 cond_new, stock_photo, durationwheels)。注意,每次移除 1/3 的数据后,所得模型会产生略有不同的模型系数。

中的点表示 图 27.3 表示每个观测值经过交叉验证模型后的预测值(x 轴)和残差(y 轴)。换言之,该模型(使用另外的 2/3 数据)构建时未使用该观测值(该观测值位于那 1/3 中)。残差让我们了解模型在预测不属于原始数据集的观测值(例如未来的研究)时的表现如何。

Cross-validation predictions and errors from linear models built on two different sets of variables. Left regressed price on cond new; right regressed price on cond new, stock photo, duration, and wheels. For each of the two models, the x-axis plots the predicted value and the y-axis plots the prediction error. More variables lead to smaller prediction errors.
(a) price 对比 cond_new
Cross-validation predictions and errors from linear models built on two different sets of variables. Left regressed price on cond new; right regressed price on cond new, stock photo, duration, and wheels. For each of the two models, the x-axis plots the predicted value and the y-axis plots the prediction error. More variables lead to smaller prediction errors.
(b) price 对比 cond_new, stock_photo, durationwheels
图 27.3:基于两组不同变量构建的线性模型的交叉验证预测值和误差。

图 27.3 (b)中,注意预测值约为 50 且预测误差约为 10 的那个点。估计该观测值的观测值和预测值。9

图 27.3 (b)中,对于预测值约为 50 且预测误差约为 10 的同一个点,描述使用了哪些交叉验证折(fold)来构建其预测模型。10

通过观察 图 27.3中交叉验证预测误差(y 轴)的离散程度,应该选择哪个模型来对这些数据进行最终报告?11

使用交叉验证误差平方和(CV SSE)这一汇总统计量,应该选择哪个模型来对这些数据进行最终报告?12

27.2 交互式 R 教程

使用以下自学教程在 R 中探索你在本部分所学的概念。你只需要一个浏览器即可开始!

您还可以访问支持本书的完整教程列表 这里.

27.3 R 实验课

通过引导您逐步完成数据分析案例研究的计算实验,在 R 中进一步应用您在本部分学到的概念。

您还可以访问支持本书的完整实验列表 这里.


  1. 该直线的方程可以写为 \(\widehat{\texttt{price}} = 47.15 + 10.90\times \texttt{cond\_new}\)。检查 表 27.3 中的回归输出,我们可以看到 cond_new 的 p 值非常接近于零,表明有强有力的证据说明在使用这个单变量模型时该系数不为零。变量 cond_new 是一个二水平分类变量,当游戏是新的时取值为 1,当游戏是二手的时取值为 0。这意味着 10.90 模型系数预测新游戏的价格比二手游戏高出 10.90 美元。↩︎

  2. \(\widehat{\texttt{price}} = 36.21 + 5.13 \times \texttt{cond\_new} + 1.08 \times \texttt{stock\_photo} - 0.03 \times \texttt{duration} + 7.29 \times \texttt{wheels},\) 有 4 个预测变量但有 5 个系数(包括截距)。↩︎

  3. 在所有拍卖的总体中,它是在保持其他变量不变的情况下,每多包含一个 Wii 方向盘时拍卖价格的平均差异。点估计为 \(b_4 = 7.29\)↩︎

  4. \(e_i = y_i - \hat{y_i} = 51.55 - 49.62 = 1.93\).↩︎

  5. 观测到的斜率为 10.9,这远不在置换斜率的取值范围内(大约 -5 到 +5)。由于观测到的斜率在零分布下不是一个合理的值,p 值基本上为零。我们拒绝原假设,并断言游戏是否为新的与游戏的平均预测价格之间存在关系。↩︎

  6. 中的 p 值 表 27.3 也基本上为零,因此当采用数学模型方法时,原假设同样被拒绝。通常,数学方法和计算方法进行推断会给出相当相似的结果。↩︎

  7. 使用自助法标准误(SE)方法,我们知道正态百分位数为 \(z^\star = 1.645\),由此得到的置信区间为 \(b_1 \pm 1.645 \cdot SE \rightarrow 10.9 \pm 1.645 \cdot 1.5 \rightarrow (8.43, 13.37).\) 在90%的置信水平下,新游戏的平均价格比二手游戏高出 $8.43 到 $13.37 之间。↩︎

  8. 由于有 1,000 次自助重抽样,我们需要寻找这样的分界点:左侧提供 50 个自助斜率,中间提供 900 个,右侧提供 50 个。观察自助法直方图,粗略的 90% 置信区间为 $9 到 $13.10。在90%的置信水平下,新游戏的平均价格比二手游戏高出 $9.00 到 $13.10 之间。↩︎

  9. 预测值大约为 \(\widehat{\texttt{price}} = \$50.\) 观测值大约为 \(\texttt{price}_i = \$60\) 名乘客(使用 \(e_i = y_i - \hat{y}_i).\)↩︎

  10. 该点似乎位于第 2 折中,因此使用第 1 折和第 3 折来构建预测模型。↩︎

  11. cond_new 上的交叉验证残差大致在 -15 到 15 之间变化,而四预测变量模型的交叉验证残差变化较小,大致在 -10 到 10 之间。鉴于四预测变量模型的残差更小,似乎较大的模型更好。↩︎

  12. 对于包含四个预测变量的模型,CV SSE 更小(几乎小了一倍!)。使用单一数值标准(CV SSE)使我们能够做出决策,选择包含四个预测变量的模型。↩︎