using System; using System.Collections.Generic; using System.Linq; using System.Text; using S = Science.Statistics.BasicStatistics; namespace Statistics4Ed.Chapter11.SetE { public class Exercise01 { public Exercise01() { } private string result; public string Result { get{return result;} } public void Compute() { S.StandardDeviationAndAverage sd = new S.StandardDeviationAndAverage(); sd.Average = 63.0; sd.StandardDeviation = 2.5; S.Variable vari = new S.Variable(sd); double su = vari.ToStandardUnit(68.0); S.NormalCurve nc = new S.NormalCurve(); double symArea = nc.AreaBetween(su, -su); double percent = (100.0 - symArea) / 2.0 + symArea; result += "(a) "+percent.ToString()+"\r\n"; S.Regression reg = new S.Regression(68.0, 2.7, 63.0, 2.5, 0.25); S.StandardDeviationAndAverage nsd = new S.StandardDeviationAndAverage(); nsd.Average = reg.PredictedYFromX(72.0); nsd.StandardDeviation = reg.RootMeanSquareErrorOfY; S.Variable nvari = new S.Variable(nsd); double nsu = nvari.ToStandardUnit(68.0); S.NormalCurve nnc = new S.NormalCurve(); double nsymArea = nnc.AreaBetween(nsu, -nsu); double npercent = (100.0 - nsymArea) / 2.0 + nsymArea; result += "(b) " + npercent.ToString() + "\r\n"; } } } /* (a) 2.27501319478037 (b) 4.61803598517533 */