I am working on this code and i can't seem to get it working, been stumped for a couple of days.
Code:
Code:
:Disp "SAMPLE SIZES"
:Input N
:If int(N/2)=N/2
:Then
:((N/2-1)!)2*2^(N-2)/(N-2)!
* (2/π /(N-1))→C
:Else
: (2π _/(N-1))*(N-1)!/((N-1)/2)!
/((N-3)/2)!/2^(N-1)→C
:End
:Disp "1=XBAR, 2=S"
:Input W
:If W=1
:Then
:2-Var Stats L1,L2
: x →M
: y /C→S
:"M"→Y1
:"M+3*S/ (N)"→Y2
:"M-3*S/ (N)"→Y3
:seq(I,I,1,dim(L1))→L3
:0→Xmin
:dim(L1)+1→Xmax
:Xmax→Xscl
:min(min(L1),M-4*S/ (N))→Ymin
:max(max(L1),M+4*S/ (N))→Ymax
:Ymax-Ymin→Yscl
:Plot1(xyLine,L3,L1,◦)
:ClrHome
:Output(1,4,"XBAR LIMITS")
:Goto 4
:Else
:1-Var Stats L2
: x /C→S
:"C*S"→Y1
:"C*S+3S (1-C2)"→Y2
:"max(C*S-3S (1-C2),0)"→Y3
:seq(I,I,1,dim(L2))→L3
:0→Xmin
:dim(L2)+1→Xmax
:Xmax→Xscl
:min(min(L2),C*S-4S (1-C2))
→Ymin
:max(max(L2),C*S+4S (1-C2))
→Ymax
:Ymax-Ymin→Yscl
:Plot1(xyLine,L3,L2,◦)
:ClrHome
:Output(1,4,"S LIMITS")
:End
:Lbl 4
:PlotsOff
:PlotsOn 1
:AxesOff
:Output(3,1,"UCL")
:Output(3,5,Y2)
:Output(4,1," CL")
:Output(4,5,Y1)
:Output(5,1,"LCL")
:Output(5,5,Y3)