**TI92P*mainL–æGSTæ6&ßTb÷S.þ—ELGS–æ–æGSÈ læV%ßTþùRscatsim¥Z6() Prgm © set up the screen and variables DelVar actua,a,ac,error,gstr,i,k,guess,l,p,q,u,v,w,xlist,ylist,z setMode("Split Screen","Full") setGraph("Axes","On") setGraph("Labels","Off") ClrHome PlotsOff FnOff ClrDraw ClrGraph © get the number of scatterplots Dialog Title "Guess the Corr. Coeff." Request "Numb of Scatterplot",ac EndDlog expr(ac)a newList(a)actua newList(a)guess newList(a)error newList(20)xlist newList(20)ylist © start the main loop. For i,1,a ©get the x and y lists for the plot tistat.randint(1,100,20)/10xlist rand()q rand()*.4p If q<.5 abs(xlist-tistat.randnorm(0,2.5+p,20))+.5ylist If qž.5 Then abs(xlist-tistat.randnorm(0,2.5+p,20))+.5ylist abs(10-xlist)xlist EndIf © calculate r tistat.linregbx(xlist,ylist) statvars\ractua[i] NewPlot 1,1,xlist,ylist,,,,2 max(xlist)u min(xlist)v max(ylist)w min(ylist)z u+(u-v)/15+.5xmax (u-v)/10xscl max(0,v-(u-v)/15)xmin ­(w-z)/6ymin w+(w-z)/15+.5ymax (w-z)/8yscl DispG ©display the plot number in upper right PxlText string(i),1,150 PxlText "GUESS r=",70,4 ©the guess is stored in string variable gstr and is built up one character at a time ""gstr 0k Loop getKey()k While k=0 getKey()k EndWhile If k=263 Then © 263 is 'clear' PxlText " ",70,50 ""gstr 0k EndIf If k=13 © 13 is 'enter' Exit gstr&char(k)gstr PxlText gstr,70,50 EndLoop expr(gstr)guess[i] © display the actual value of r PxlText "r="&string(round(statvars\r,3)),70,100 EndFor ©report score tistat.linregbx(actua,guess) Dialog Text "correlation between actual" Text "and guess is "&string(round(statvars\r,3)) EndDlog ©plot the error over time guess-actuaerror seq(x,x,1,dim(error))l NewPlot 1,1,l,error,,,,2 ZoomData ymin-.11*(ymax-ymin)ymin DispG PxlText "Your errors over time",69,5 Pause ©plot the error vs. actual r NewPlot 1,1,actua,error,,,,2 ZoomData ymin-.11*(ymax-ymin)ymin DispG PxlText "Your errors vs actual",69,5 Pause © Clean up the variables DelVar actua,a,ac,error,gstr,i,k,guess,l,p,q,u,v,w,xlist,ylist,z setFold(statvars) DelVar a,b,r,regeqn,resid,rsq,shostat setFold(main) EndPrgmäåܲ