Download Standard deviation

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Bootstrapping (statistics) wikipedia , lookup

History of statistics wikipedia , lookup

Regression toward the mean wikipedia , lookup

Time series wikipedia , lookup

Transcript
CS0004
Visual Basic 2082
Mr. Trentini
Assignment #4 Rubric
Due Date: April 16, 2008
No late papers accepted.
Objective:
You will create a Visual Basic 2005 project that will read a data file, calculate average GPA, and the
difference (+/-) for each student GPA from the average. You are required to use one and two dimentional
parallel arrays to store data during execution
Assignment Task List
1. Create a VB project named Assign04-082, project and files will be stored in the folder Assign04082
2. Your form will be frmGrades. The data file should be saved as D04_In.txt Use the data shown
on the sample form (other side). You are free to design your own project form. Remember to
follow the guidelines you have learned.
3. When the user clicks on the Average Score menu option, the average score ( Mean ) and Standard
Deviation (SD) should be displayed in labels.
4. When the user clicks on the Difference menu option, the difference between the average score and
each student score should be calculated and displayed, by name, in a ListBox.
5. When the user clicks on the Grades menu option, the grades will be calculated using the SD and a
Bell Curve as follows.
Score >= (Mean >= +2 SD)
A
Score >= (Mean >= +1 SD)
B
Score >= (Mean ± 1 SD)
C
Score >= (Mean <= -1 SD)
D
Score < (Mean <= -2 SD)
F
Students Names and grades will be posted in a ListBox and written to an output file (stored in the
Bin folder) named D04_Out.txt..
6. The Sort menu option will allow the user to rearrange the data by last name (Ascending) or Score
(Descending)
7. The Search menu option will allow the user to search the data by last name and return via a
message box the Grade of the student. If the student is not in the data, an appropriate message
should be displayed. Your search must be case insensitive.
8. All of the command buttons and menu items should be able to be activated by using an Access
key.
9. The input data file should contain the last name, first name, and Score ( 0 to 100 ) for each student.
10. The output data file will contain the above and the letter grade.
11. The program code will calculate everything else. Note: A different data file will be used for
grading.
D:\840954591.doc
©2008 Louis Trentini. All rights reserved.
12. Menus for Edit and Data should not be active if the File has not been opened. The Difference
menus should not be available until the Average Score has been calculated.
Menu for the Grades form;
File
Edit
Data
Open File
Add student
Average
Print
Delete student
Difference
Exit
Grades
Search
Sort
Name
Score
13. Test your executable program (on your media) before turning it in.
14. On the due date you will be responsible for turning in:
a. both data files,
b. a loaded image of your form, and
c. the code.
Deductions:
Incorrect Folder Name
Incorrect Project Name
No Executable File
Appearance of Interface
Standard use of Written Code
Program does not meet requirements
5%
5%
5%
5%
10%
70%
Data file: D05_In.txt
Drawers
Baroo
Sonite
Lichous
Knee
Clone
Beach
Steak
Dice
Utiful
Mongous
Harmonic
Orious
Limoni
Leer
Tree
Matto
Monize
Lution
Chester
Sue
Sam
Dee
Bo
Sy
Sandy
Chuck
John
Bea
Hugh
Phil
Greg
Al
Chandra
Paul
Tom
Si
Sol
D:\840954591.doc
©2008 Louis Trentini. All rights reserved.
98
79
92
98
67
100
82
91
80
71
61
55
85
74
82
74
91
76
95
Mental
Alize
Pendus
Erachi
Nominious
Adore
Fully
Reggy
Ann
Stu
Liv
Iggy
Steve
Will
99
80
61
75
48
79
83
Standard deviation
In probability and statistics, the standard
deviation of a probability distribution,
random variable, or population or multiset
of values is a measure of the spread of its
values. The standard deviation is usually
denoted with the letter σ (lower case
sigma). It is defined as the square root of
the variance.
To understand standard deviation, keep in
mind that variance is the average of the
squared differences between data points
and the mean. Variance is tabulated in
units squared. Standard deviation, being
the square root of that quantity, therefore
measures the spread of data about the
mean, measured in the same units as the
data.
Stated more formally, the standard
deviation is the root mean square (RMS)
deviation of values from their arithmetic
mean.
For example, in the population {4, 8}, the
mean is 6 and the deviations from mean
are {−2, 2}. Those deviations squared are
{4, 4} the average of which (the variance)
is 4. Therefore, the standard deviation is 2.
In this case 100% of the values in the
population are at one standard deviation
from the mean.
The standard deviation is the most
common measure of statistical dispersion,
measuring how widely spread the values
D:\840954591.doc
©2008 Louis Trentini. All rights reserved.
in a data set are. If many data points are
close to the mean, then the standard
deviation is small; if many data points are
far from the mean, then the standard
deviation is large. If all the data values are
equal, then the standard deviation is zero.
For a population, the standard deviation
can be estimated by a modified standard
deviation (s) of a sample. The formulas
are given below.
Definition and calculation
A simple example
Suppose we wished to find the standard
deviation of the set of the numbers 4 and
8.
Step 1: find the arithmetic mean (or
average) of 4 and 8,
(4 + 8) / 2 = 6.
Step 2: find the deviation of each number
from the mean,
4−6=−2
8 − 6 = 2.
Step 3: square each of the deviations
(amplifying larger deviations and making
negative values positive),
( − 2)2 = 4
22 = 4.
Step 4: sum the obtained squares (as a
first step to obtaining an average),
4 + 4 = 8.
Step 5: divide the sum by the number of
values, which here is 2 (giving an
average),
8 / 2 = 4.
Step 6: take the non-negative square root
of the quotient (converting squared units
back to regular units),
So, the standard deviation is 2.
In other words, the standard deviation of a
discrete uniform random variable X can be
calculated as follows:
1. For each value xi calculate the
difference
between xi and the
average value .
2. Calculate the squares of these
differences.
3. Find the average of the squared
differences. This quantity is the
variance σ2.
4. Take the square root of the
variance.
The above expression can also be
replaced with
D:\840954591.doc
©2008 Louis Trentini. All rights reserved.