# Is variance replacing square of standard deviation in a t test?

I am writing a t test using the code here :

How to perform two-sample t-tests in R by inputting sample statistics rather than the raw data?

But I would like to use the root of the variance as an estimator of the standard deviation.

Why? Because I can pass only once through my data to have mean and variance.

For standard deviation, I need the mean so I need to scan my data twice.

• The square root of the variance is in fact the standard deviation. You need to know the mean to calculate either one. – Andrew Mar 5 '14 at 21:07
• You can calculate either variance or standard deviation in one pass (but beware, there are bad algorithms and good algorithms, and the most obvious algorithms are the bad ones). – Glen_b Mar 5 '14 at 22:01