QUESTIONS
Dear friends:
Does anyone know / remember how to obtain the standard deviation of a set
of numbers given only a frequency table?
e.g.,
x f(x)
0 0.2
1 0.3
2 0.2
3 0.2
4 0.1
Many thanks.
Chris
ONE POSSIBLE ANSWER:
Here is a worked solution. I used the Windows TextPad editor to cut
your table out of your email messaage. Though not really needed here,
I love TextPad for statistical work because you can cut out individual
COLUMNS of data from a table to paste into stats. doftware.
http://www.textpad.com/
Then I pasted the table into Minitab and ran a macro I wrote for this
purpose. Your "frequencies" are actually relative frequencies and the
macro treats them as probabilities. This is equivalent to dividing by
n rather than n-1 in computing the variance and standard deviation.
It's the best you can do if you don't know n and a good approximation
if n is large.
Worksheet size: 100000 cells
Welcome to Minitab!-)
* NOTE * Standard Graphics are enabled.
Professional Graphics are disabled.
Use the GPRO command to enable Professional Graphics.
MTB > read into c1 c2
DATA> 0 0.2
DATA> 1 0.3
DATA> 2 0.2
DATA> 3 0.2
DATA> 4 0.1
DATA> end
5 rows read.
MTB > Execute "E:\STATS\MINITAB8\STATS1A\MACROS\VARPD.MTB"
Executing from file: E:\STATS\MINITAB8\STATS1A\MACROS\VARPD.MTB
This macro computes the mean, variance, and standard
deviation of a probability distribution. The data values
must be stored in c1 and their probabilities in c2.
The results of all intermediate steps are printed out
to aid students in learning to do these computations
by hand. The macro will destroy any data stored in c2-c6,
k1-k7, and any names given to c1-c6.
------------------------------------------------------------
Row x p xp resids. res.sq. res.sq.p
1 0 0.2 0.0 -1.7 2.89 0.578
2 1 0.3 0.3 -0.7 0.49 0.147
3 2 0.2 0.4 0.3 0.09 0.018
4 3 0.2 0.6 1.3 1.69 0.338
5 4 0.1 0.4 2.3 5.29 0.529
------------------------------------------------------------
MTB > print k1 mean =
K1 1.70000
MTB > print k4 variance =
K4 1.61000
MTB > print k7 standard deviation =
K7 1.26886
MTB > end
MTB >
If you do know n, multiply the variance above by n/(n-1) to get the
variance with a divisor of n-1.
Here is the macro if you want it. The "let" statements show you
exactly what is being calculated at each step.
notitle
note
note This macro computes the mean, variance, and standard
note deviation of a probability distribution. The data values
note must be stored in c1 and their probabilities in c2.
note The results of all intermediate steps are printed out
note to aid students in learning to do these computations
note by hand. The macro will destroy any data stored in c2-c6,
note k1-k7, and any names given to c1-c6.
note
noecho
let c3=c1*c2
let k1=sum(c3)
let c4=c1-k1
name c1 'x', c2 'p', c3 'xp', c4 'resids.'
let c5=c4*c4
name c5 'res.sq.'
let c6=c5*c2
name c6 'res.sq.p'
let k4=sum(c6)
let k7=sqrt(k4)
note ------------------------------------------------------------
print c1-c6
note ------------------------------------------------------------
echo
print k1 mean =
print k4 variance =
print k7 standard deviation =
end
--
_
| | Robert W. Hayden
| | Work: Department of Mathematics
/ | Plymouth State College MSC#29
| | Plymouth, New Hampshire 03264 USA
| * | fax (603) 535-2943
/ | Home: 82 River Street (use this in the summer)
| ) Ashland, NH 03217
L_____/ (603) 968-9914 (use this year-round)
Map of New [EMAIL PROTECTED] (works year-round)
Hampshire http://mathpc04.plymouth.edu (works year-round)
The State of New Hampshire takes no responsibility for what this map
looks like if you are not using a fixed-width font such as Courier.
"Opportunity is missed by most people because it is dressed in
overalls and looks like work." --Thomas Edison
=================================================================
Instructions for joining and leaving this list and remarks about
the problem of INAPPROPRIATE MESSAGES are available at
http://jse.stat.ncsu.edu/
=================================================================