I wonder whether there is a way to select the standard deviation from several integer fields in MySQL within the same row. Obviously, if I use
I found two solutions on my own:
1) Normalize the database. I end up with two tables:
table one uid | information1 | metainformation2
table two uid | col | result_of_col
Then I can easily use the standard STDDEV function.
2) Use R. The data is a de-normalized format because it should be used in statistical analysis. Thus it´s easy to get into R and use the following code.
sd(t(dataset[1:4,3:8]))
Note that, I just take the numeric part of this data.frame by leaving selecting the columns 3-8. And dont get hit by too much data (that´s why I only use the first couple of rows this time). t() transposes the data which is necessary because sd() only works with columns.
There´s a function rowSds around in the vsn package, that is supposed to work analogously to rowMean and rowSum, but somehow this might be deprecated. At least this packages was not available on the Swiss CRAN mirror ;) .
HTH someone else.