Hello I want to know how I can calculate the standard deviation of a column of a data file using gnuplot. I know gnuplot to refer to a column using n $ n, but how do I (could serve a function) to add all values of $ n. That's all I can't do in gnuplot and they do not want to have to use some external program. And since gnuplot uses the notation $ n, I guess that this is possible, but not how. Any suggestions?
there is a command for that: stats
example for using the whole 2nd column:
stats "filename" using 2 name "A"
this gives you detailed information in the terminal and you can use the data with the suffix (here "A") like:
plot "filename" t "data", A_mean t "mean value"
see also help stats
for more information on the command
Play some tricks, gnuplot can do this kind of work. I have talked about "Statistic analysis using gnuplot" in two of my blog articles. The mean value, maximum, minimum, standard deviation are all covered. Here is the urls:
http://gnuplot-surprising.blogspot.com/2011/09/statistic-analysis-using-gnuplot-0.html
http://gnuplot-surprising.blogspot.com/2011/09/statistic-analysis-using-gnuplot-1.html
May be you can find what you want from these two articles!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With