Posted on Categories:Regression Analysis, 回归分析, 统计代写, 统计代考

# 统计代写|回归分析代写Regression Analysis代考|Evaluating the Uncorrelated Errors Assumption Using Graphical Methods

avatest™

## avatest™帮您通过考试

avatest™的各个学科专家已帮了学生顺利通过达上千场考试。我们保证您快速准时完成各时长和类型的考试，包括in class、take home、online、proctor。写手整理各样的资源来或按照您学校的资料教您，创造模拟试题，提供所有的问题例子，以保证您在真实考试中取得的通过率是85%以上。如果您有即将到来的每周、季考、期中或期末考试，我们都能帮助您！

•最快12小时交付

•200+ 英语母语导师

•70分以下全额退款

## 统计代写|回归分析代写Regression Analysis代考|Evaluating the Uncorrelated Errors Assumption Using Graphical Methods

To evaluate the uncorrelated errors assumption, you first have to consider the type of data set you have, whether it is pure time-series, cross-sectional time-series, spatial, repeated measures, or multilevel (grouped) data. With pure time-series data, it is common to let $t$ denote the observation indicator rather than $i$, and it is common to let $T$ denote the number of time points in the data set rather than $n$, so the set of observations is indexed by $t=1,2, \ldots, T$, rather than by $i=1,2, \ldots, n$.

The uncorrelated errors assumption is often badly violated with pure time-series processes, because, e.g., today is similar to yesterday, but not so similar to five years ago. Thus, the potentially observable values of today’s error term, $\varepsilon_t$, are often highly correlated with potentially observable values of yesterday’s error term, $\varepsilon_{t-1}$, implying a violation of the uncorrelated errors assumption.

To diagnose correlated errors with pure time-series data, you should first examine the time-series residual graph, or $\left(t, e_t\right)$. Look for systematic, non-random patterns, such as trends or sinusoidal-type functional patterns to suggest failure of this assumption. A completely random appearance of this graph is consistent with uncorrelated errors.

The most common type of residual correlation is the correlation of the current error $\varepsilon_t$ with the previous error $\varepsilon_{t-1}$, which is called the “lagged” error term. Such correlation is called autocorrelation because it refers to the correlation of a variable with itself. Thus, the second graph you can view is the lag scatterplot, or $\left(e_{t-1}, e_t\right)$, upon which you can superimpose the OLS or LOESS fit to see the trend. A trend in this plot suggests dependence between the current residual and the immediately preceding residual, a violation of the uncorrelated errors assumption. A random scatter with no trend is consistent with uncorrelated errors.

A third kind of plot is the autocorrelation function of the residuals, which displays lag 1, $\operatorname{lag} 2$, lag 3, and more autocorrelations, thus you can use this plot to examine autocorrelations for lags greater than 1.

For data other than pure time-series data, different methods are needed. For spatial data (points in “space,” e.g., data with geographic coordinates), you can use a variogram to check for error correlation, in this case called “spatial autocorrelation.” With multilevel (grouped) data, you can examine scatterplots where data are labeled by group to diagnose correlation structure; Chapter 10 touches upon this issue. For now, we will discuss only pure time-series data.

## 统计代写|回归分析代写Regression Analysis代考|The Car Sales Data $\left(t, e_t\right)$ and $\left(e_{t-1}, e_t\right)$ Plots

The Car Sales data are pure time-series since the data are collected in 120 consecutive months. The following code shows the relevant plots to check for uncorrelated (specifically, non-autocorrelated) errors.
CarS = read.table(“https://raw.githubusercontent.com/andrea2719/
URA-DataSets/master/Cars.txt”)
attach(CarS); $\mathrm{n}=$ nrow(CarS)
fit $=$ lm(NSOLD $~$ INTRATE)
resid $=$ fit\$residuals par(mfrow=c(1,2)) plot($1: n$, resid, xlab=”month”, ylab=”residual”) points($1: n$, resid, type=”l”); abline(h=0) lag.resid = c(NA, resid[1:n-1]) plot(lag.resid, resid, xlab=”lagged residual”, ylab= “residual”) abline(lsfit(lag.resid, resid)) Cars$=$read.table$($“https://raw.githubusercontent. com/andrea$2719 /$URA-DataSets/master/Cars.txt”) attach (Cars);$n=\operatorname{nrow}(\operatorname{Cars})\mathrm{fit}=\operatorname{lm}(\mathrm{NSOLD} \sim$INTRATE$)$resid$=$fit\$residuals
par (mfrow=c $(1,2))$
plot ( $1: n$, resid, $x l a b=$ “month”, ylab=”residual”)
points $(1: \mathrm{n}$, resid, type=”I”); abline $(\mathrm{h}=0)$
lag.resid $=c(N A, r e s i d[1: n-1])$
plot (lag.resid, resid, $x l a b=$ “lagged residual”, ylab = “residual”)
abline(lsfit (lag.resid, resid))
The results are shown in Figure 4.8. There is overwhelming evidence of autocorrelation shown by both plots.

What are the consequences of such an extreme violation of assumptions? According to the mathematical theorems summarized in Chapter 3 , if the data-generating process is truly given by the regression model, then the confidence intervals and $p$-values behave precisely as advertised, with precisely 95\% confidence, and precisely 5\% significance levels. When the independence assumption is grossly violated as seen here, the true confidence levels may be far from 95\% and the true significance levels may be far from 5\%. How far? You guessed it: You can find out by using simulation.

## 统计代写|回归分析代写Regression Analysis代考|The Car Sales Data $\left(t, e_t\right)$ and $\left(e_{t-1}, e_t\right)$ Plots

Car Sales数据是纯时间序列，因为数据是连续120个月收集的。下面的代码显示了检查不相关(特别是非自相关)错误的相关图。
CarS = read.table(“https://raw.githubusercontent.com/andrea2719/ .table “)
“URA-DataSets/master/Cars.txt”)
attach(CarS);$\mathrm{n}=$ nrow(CarS)
fit $=$ lm(NSOLD $~$ INTRATE)
Resid $=$ fit＄残差
par(mfrow=c(1,2))

abline(lsfit);残留，残留))

“URA-DataSets/master/Cars.txt”)

$\mathrm{fit}=\operatorname{lm}(\mathrm{NSOLD} \sim$ INTRATE $)$
Resid $=$ fit＄残差
Par (mfrow=c $(1,2))$

points $(1: \mathrm{n}$, resid, type=”I”);在线$(\mathrm{h}=0)$

Abline (lsfit (lag))残留，残留))

## MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。