... and then I checked the numbers. I did
'SELECT FORMAT(STD(minval),2) FROM scoreattrs WHERE minval > 0'
in MySQL and got 185.04.
I put the same query into R and got 188.4393.
I can't understand why they are different?
I displayed the contents of minval_df and it listed the same 28 numbers I get in MySQL.
These are the 28 minvals in the table:
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,3,7,10,10,65,65,1000
Excel says the answer is 185.04 so what am I doing in R to cause it to be wrong?
Sorry to keep pestering you, I need to work this out!
This is my R Script:
minval_df <- dbGetQuery(DB, 'SELECT minval FROM Scoreattrs where minval > 0')
minval_df
minval
1 1
2 2
3 2
4 1000
5 3
6 1
7 1
8 1
9 1
10 65
11 1
12 1
13 65
14 1
15 1
16 1
17 1
18 1
19 1
20 1
21 1
22 10
23 7
24 1
25 10
26 1
27 1
28 1
sd(minval_df$minval)
[1] 188.4393