Simple function for obtain a T statistic from sample mean, stdev & hypothetical mean

2 ビュー (過去 30 日間)
John Strong
John Strong 2015 年 7 月 10 日
コメント済み: Frank Schumann 2023 年 5 月 1 日
Is there a Matlab function that will take sample values (mean, stdev) together with a hypothetical mean and return a T value without requiring me to enter all the sample data?
If it is not a native feature, can you recommend an open source library of Matlab functions?

回答 (1 件)

Jeff Miller
Jeff Miller 2023 年 5 月 1 日
Here you go:
t_observed = (sample_mean - hypothetical_mean) / sample_sd * sqrt(n);
n is the number of scores averaged to get the sample_mean
sample_sd is the version normalized by n-1 (i.e., MATLAB's default)
  1 件のコメント
Frank Schumann
Frank Schumann 2023 年 5 月 1 日
Thank you. Maybe I misunderstood the original question then: I'm looking for a function to get the full ttest results, that also calculates h, p, stats, allows me to specify a one or two-sided test, etc.
The original question was not. I can do all this manually, but it would be so much more convenient to be able to simply input summary statistics (mean, std, n) into the ttest or ttest2 function.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeTime Series についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by