In: Statistics and Probability
Passive and active solar energy systems are becoming viable options to home builders as installation and operating costs decrease. Laminated solar modules utilize high-quality, single-crystal, silicon solar cells, connected electrically in series, to deliver a specified power output. Research was conducted to investigate the relationship between the solar cell temperature (°C) rise above ambient and the amount of insulation (megawatts per square centimeter). Data collected for six solar cells sampled under identical experimental conditions are recorded in the table attached.
Temp Rise | Insulation |
9 | 25 |
25 | 70 |
20 | 50 |
12 | 30 |
15 | 45 |
22 | 60 |
1)The independent variable is the Temp rise and the
dependent variable is Insulation
2 & 3)The estimated model is
Insulation= -0.4105+2.7424*Temp rise
4) R_sq=0.9675
This means that 96% of the explaned variablity is explaned by the model
5)p_value=0.000399757<0.05
this means that we reject the null hypothesis stating that there exists a linear relationship between Temp rise and insulation
6)
For the data, when we look at the plot below, we see that the data does not have any obvious distinct pattern. While it is slightly curved, it has equally spread residuals around the horizontal line without a distinct pattern.
This is a good indication it is a linear relationship.
7)
The residuals follow close to a straight line on this plot, it is a good indication they are normally distributed.
8)r square is the percentage of the dependent variable variation that a linear model explains. 96% represents a model that explains a fairly good variation in the response variable around its mean.hence we can say that this model is perfect to explain the relationship between the temp rise and the insulation
9)
10) fit lwr upr
109.2838 92.88059 125.6871
fit lwr upr
109.2838 90.26043 128.3073
r codes
Temp_rise<-c(9,25,20,12,15,22)
Insulation<-c(25,70,50,30,45,60)
data<-as.data.frame(cbind(Temp_rise,Insulation))
View(data)
scatter.smooth(x=data$Temp_rise,y=data$Insulation,main="Insulation~Temp_rise")
abline(lm(Insulation ~ Temp_rise))
par(mfrow=c(1, 2))
boxplot(data$Temp_rise, main="Temp_rise", sub=paste("Outlier rows:
", boxplot.stats(data$Temp_rise)$out))
boxplot(data$Insulation, main="Insulation", sub=paste("Outlier
rows: ", boxplot.stats(data$Insulation)$out))
library(e1071)
par(mfrow=c(1, 2))
plot(density(data$Temp_rise), main="Density Plot: Temp_rise",
ylab="Frequency", sub=paste("Skewness:",
round(e1071::skewness(data$Temp_rise), 2)))
polygon(density(data$Temp_rise), col="red")
plot(density(data$Insulation), main="Density Plot: Insulation",
ylab="Frequency", sub=paste("Skewness:",
round(e1071::skewness(data$Insulation), 2)))
polygon(density(data$Insulation), col="red")
cor(data$Temp_rise,data$Insulation)
linearMod <- lm(Insulation ~ Temp_rise, data=data)
print(linearMod)
summary(linearMod)
modelSummary <- summary(linearMod)
modelCoeffs <- modelSummary$coefficients
beta.estimate <- modelCoeffs["Temp_rise", "Estimate"]
std.error <- modelCoeffs["Temp_rise", "Std. Error"]
t_value <- beta.estimate/std.error
p_value <- 2*pt(-abs(t_value), df=nrow(data)-ncol(data))
f_statistic <- linearMod$fstatistic[1]
f <- summary(linearMod)$fstatistic
model_p <- pf(f[1], f[2], f[3], lower=FALSE)
p_value
t_value
f
model_p
plot(linearMod, which=2, col=c("red")) # Q-Q Plot
abline(lm(Insulation ~ Temp_rise))
new.dat <- data.frame(Temp_rise=40)
predict(linearMod, newdata = new.dat, interval =
'prediction')