Correlation
sample correlation coefficient: r, from -1 to 1
Linear regression
Assumptions:
• The residuals are normally distributed and homeostatic
• The errors are independent
• The relationships are linear
Outliers
具体代码
首先构建模型。再进行下一步的假设检验
model <- lm(y ~ x, data = df)
summary(model)
Then we check the assumptions of linear regression for each of the fitted models in the models_late object. It iterates over the list of models and generates four diagnostic plots for each model: residuals vs. fitted values, normal Q-Q plot, scale-location plot, and residuals vs. leverage plot. These plots help assess the assumptions of linearity, normality, homoscedasticity, and the absence of influential observations.
par(mfrow = c(2,2))
plot(model)
Although not all subsets of real-world data can perfectly meet the assumptions, but we consider that most models fit these assumption and no model strangely break these rules, therefore these linear regression models are robust and acceptable.
标签:plot,Linear,models,assumptions,model,regression From: https://www.cnblogs.com/chen-heybro/p/18207702