PROBLEM

The following data related to the life in hrs of fifteen samples of six electric bulbs each drawn at intervals of 1 hour from a production process. Draw the Mean-Chart and Range-chart.

    S.no                                 Life time     
1620687666769839686
2501585524585655668
3673701636567622660
4646626572628632743
5494984659643660640
6634755625582685555
7619710664693773534
8631723614535551570
9482791533612497499
10706524626503662754
11530432379690724536
12485497608393648729
13585535762588625737
14462490635587554673
15722608665587531705

Theory-

Control limits-

For any continuous process having variable T. 3-Sigma Control limits are given as-

And Central Line = µT

Control Chart for Mean-

When Standard Given-

Let given standard given value for mean and standard deviation be-

Then Upper Control Limit (UCL), Lower Control Limit (LCL) and Central Line are given by-

Where A is function of n(sample size) and can be obtained from mean chart table.

When Standard Not Given-

In This case we first estimate population mean, population varience and population range as-

Where m is number of samples,  is sample mean, s is sample variance, R sample Range.

And as we already know-

E(s) = c2

E(R) = d2

Where c2 and d2 are function of n (sample size)

Therefore the control limits values are –

Where A1 is a function of n (sample size) and can be obtained from mean chart table.

And The control limits values are-

Where A2 is a function of n (sample size ) and can be obtained from mean chart.

Since, We have to plot the mean and range chart, lets look at the Control limits of Range-

Control Chart for Range-

We know that-

E(R) = d2.σ , and

σR = D.σ, where d2 and D are functions of n(sample size).

When standard σ is given as σ’-

Then control limits for Range is given as-

Lower control limit, LCL = d2.σ’ – 3.D.σ’ = D1.σ’

Upper control limit, UCL = d2.σ’ – 3.D.σ’ = D2.σ’

Central Line = d2.σ’

Where D1 and D2 are functions of n(sample size) and can be obtained from Range chart.

When standards are not given-

Hence the modified control limits are obtained as-

Where D3, D4 are functions of n (sample size ) and can be obtained from Range chart table.

R Code For Mean Chart and Range Chart-

#Command To Remove Previous Objects
rm(list=ls())

#Loading Some Library
library(readxl)   
library(readr)

#Loading The Given Data set And checking The Characteristics
BulbData=read_excel("class work 09.xlsx")   
View(BulbData)   
mode(BulbData)


#Creating Somr Variable
No_of_Samp=length(BulbData[[1]])
SampList=list()   
SampVec=c()
SampMean=c()
SampRange=c()

#Extracting Different Samples, their Means and Range
for (i in 1:No_of_Samp) {   
  for (j in 2:7) {
    SampVec[j-1]=BulbData[[j]][i]
  }
  SampList[[i]]=SampVec[]
  SampMean[i]=mean(SampList[[i]])
  SampRange[i]={max(SampList[[i]])-min(SampList[[i]])}
}

#Obtaining Table Of Calculated Sample Means And Ranges
Sample_No=c(1:No_of_Samp)
calculatedData=data.frame()   
calculatedData=data.frame(Sample_No,SampMean,SampRange)
calculatedData

#Estimating The Mean And The Range Of Population
mean_of_means=mean(SampMean)
mean_of_Ranges=mean(SampRange)

#Calculating UCL, LCL And Central Line Of Process Control For Mean
A2=0.483 #for n=6, A2=0.483 from Mean Chart, Appendix B(Goon,Gupta,DasGupta, Fundamental Of Statistics Vol-2)
lcl=mean_of_means-(A2*mean_of_Ranges)   #Formula For LCL
if(lcl<0){lcl=0}
LCL=lcl
UCL=mean_of_means+(A2*mean_of_Ranges)   #Formula For UCL
CENTRAL_LINE=mean_of_means
View(data.frame(LCL,CENTRAL_LINE,UCL))

#Plotting The Process Control Graph For Mean Of Given Data
plot(Sample_No,rep(CENTRAL_LINE,No_of_Samp),type="l",ylim=c(450,850),col="black",lwd=3,ylab="Sample Means",main="Mean Chart Of Given Data")
lines(rep(UCL,No_of_Samp),type="l",col="red",lwd=3)
lines(rep(LCL,No_of_Samp),type="l",col="yellow",lwd=3)
lines(SampMean,type="b",col="green",lwd=3)

#Drawing The Legend
legend("topright",legend=c(expression(bold("Upper Line = UCL")),expression(bold("Middle Line = Central Line")),expression(bold("Lower Line = LCL"))),fill=c("red","black","yellow"))

#Calculating UCL, LCL And Central Line Of Process Control For Mean
D3=0   #For n=6, D3=0 And D4=2.004 from Range Chart, Appendix B (Goon,Gupta,Dasgupta, Fundamental Of Statistics Vol-2)
D4=2.004
lcl_Range = D3*mean_of_Ranges   #Formula Of LCL
if(lcl_Range<0){lcl_Range=0}
LCL_Range=lcl_Range
UCL_Range=D4*mean_of_Ranges   #Formula Of UCL
CENTRAL_LINE_RANGE=mean_of_Ranges
View(data.frame(LCL_Range,CENTRAL_LINE_RANGE,UCL_Range))


#Plotting The Process Control Graph For Range Of Given Data
plot(Sample_No,rep(CENTRAL_LINE_RANGE,No_of_Samp),type="l",ylim=c(0,700),col="black",lwd=3,ylab="Sample Ranges",main="Range Chart Of Given Data")
lines(rep(UCL_Range,No_of_Samp),type="l",col="blue",lwd=3)
lines(rep(LCL_Range,No_of_Samp),type="l",col="violet",lwd=3)
lines(SampRange,type="b",col="green",lwd=3)

#Drawing The Legend
legend("topright",legend=c(expression(bold("Upper Line = UCL")),expression(bold("Middle Line = Central Line")),expression(bold("Lower Line = LCL"))),fill=c("blue","black","violet"))

Some Useful Insights from the R Console-

Sample Means And Ranges-

#Obtaining Table Of Calculated Sample Means And Ranges
Sample_No=c(1:No_of_Samp)
calculatedData=data.frame()   
calculatedData=data.frame(Sample_No,SampMean,SampRange)
View(calculatedData)
Sample_NoSampMeanSampRange
1711.1667219
2586.3333167
3643.1667134
4641.1667171
5680.0000490
6639.3333200
7665.5000239
8604.0000188
9569.0000309
10629.1667251
11548.5000345
12560.0000336
13638.6667227
14566.8333211
15636.3333191

Estimated Population Mean And Range and their Control Limits-

Mean and its control limits-

View(data.frame(LCL,CENTRAL_LINE,UCL))
LCLCENTRAL_LINEUCL
502.8462621.2778739.7094

Range and its control limits-

View(data.frame(LCL_Range,CENTRAL_LINE_RANGE,UCL_Range))
LCL_RangeCENTRAL_LINE_RANGEUCL_Range
0245.2491.3808

Output Control Chart for Mean-

#Plotting The Process Control Graph For Mean Of Given Data
plot(Sample_No,rep(CENTRAL_LINE,No_of_Samp),type="l",ylim=c(450,850),col="black",lwd=3,ylab="Sample Means",main="Mean Chart Of Given Data")
lines(rep(UCL,No_of_Samp),type="l",col="red",lwd=3)
lines(rep(LCL,No_of_Samp),type="l",col="yellow",lwd=3)
lines(SampMean,type="b",col="green",lwd=3)

#Drawing The Legend
legend("topright",legend=c(expression(bold("Upper Line = UCL")),expression(bold("Middle Line = Central Line")),expression(bold("Lower Line = LCL"))),fill=c("red","black","yellow"))

Conclusion-

From above mean chart we observe that the process is in well control as far as mean lifespan of the bulbs are concerned as all the points lies well within control limits.

Output Control Chart for Range-

#Plotting The Process Control Graph For Range Of Given Data
plot(Sample_No,rep(CENTRAL_LINE_RANGE,No_of_Samp),type="l",ylim=c(0,700),col="black",lwd=3,ylab="Sample Ranges",main="Range Chart Of Given Data")
lines(rep(UCL_Range,No_of_Samp),type="l",col="blue",lwd=3)
lines(rep(LCL_Range,No_of_Samp),type="l",col="violet",lwd=3)
lines(SampRange,type="b",col="green",lwd=3)

#Drawing The Legend
legend("topright",legend=c(expression(bold("Upper Line = UCL")),expression(bold("Middle Line = Central Line")),expression(bold("Lower Line = LCL"))),fill=c("blue","black","violet"))

Conclusion-

From above range chart we observe that the process is well control except a disruption is observed in 5th sample as the point is lying very far from central line distinct from all other points.