服务热线
178 0020 3020
1. 利用以下数据进行一元线性回归。
X <- c(0.11,0.12,0.13,0.14,0.15,0.16,0.17,0.18,0.19,0.20,0.23)
Y <- c(42.0,43.5,45.0,45.5,45.0,47.5,49.0,53.0,50.0,55.0,55.0)#输入数据#
plot(Y~X)#绘制散点图#
a<-lm(Y~X)#线性分析#
summary(a)#查看线性结果#
P代表显著性
Y=29.029+118.639X
abline(a)#绘制趋势线#
2. 读入数据 BCA.csv(使用BCA法测定蛋白浓度,使用使用已知浓度标定建立标准曲线(一元线性回归),测定未知蛋白浓度)
data<- read.csv(file.choose())
data
Y <-data$CON
X <-data$std_ave
LN<-lm(Y~X)
plot(X,Y,main = "A7:linear regression",
sub = "BCA method for Protein Concentration measurement",
xlab = "OD 750",
ylab = "Concentraion(units:ug/ul)")
abline(LN,
col = 'red',
lwd = 2,
lty = 2)
sam <- data.frame(X = data$sam_ave)
sam_pred <- predict(LN,sam,interval = "prediction",level = 0.95)
sam_pred
points(data$sam_ave,sam_pred[,1],
col = "red",
pch = c("A","B","C","D"),
cex =3 )
par(mfrow=c(2,2));plot(LN)
附件