How to calculate Standard error of mean as shown in minitab website

227 views (last 30 days)
Hi, I trying to recreate the minitab formula(so that I can use it in Matlab) for calculating standard error of mean as shown in this link Step 2 ( http://support.minitab.com/en-us/minitab-express/1/help-and-how-to/modeling-statistics/anova/how-to/two-way-anova/interpret-the-results/key-results/ ). However, I am unable to get the answer as shown on the web ? is there anyone who knows how ?

Answers (2)

Star Strider
Star Strider on 18 Dec 2016
The Minitab site doesn’t show the calculation, so I assume it’s the usual definition:
data = rand(1, 10);
SEM = std(data)/sqrt(length(data)); % Standard Error Of The Mean
  5 Comments
crixus
crixus on 18 Dec 2016
Anyway, I finally got how to calculate it. Thanks for you help anyway. Appreciate it.

Sign in to comment.


Liam Walsh
Liam Walsh 2 minutes ago
To summarize the discussion above, it seems like you are looking to replicate the two-way ANOVA example in Minitab, and get some standard error estimates for the mean. You can do this my making use of the anova2 function or the anova object. Below is an example on how to use the object, which contains a display with several standard quantities in ANOVA including the mean squares value, along with properties and object methods that can be used to examine other quantities in the analysis:
% Load sample data
load popcorn.mat
brand = [repmat("Gourmet",6,1);repmat("National",6,1);repmat("Generic",6,1)];
poppertype = [repmat("Air",3,1);repmat("Oil",3,1);repmat("Air",3,1);repmat("Oil",3,1);repmat("Air",3,1);repmat("Oil",3,1)];
factors = {brand,poppertype};
% Create anova object and show the display, which contains the mean squares
% values
aov = anova(factors,popcorn(:),FactorNames=["Brand" "PopperType"])
aov =
2-way anova, constrained (Type III) sums of squares. Y ~ 1 + Brand + PopperType SumOfSquares DF MeanSquares F pValue ____________ __ ___________ ___ __________ Brand 15.75 2 7.875 63 1e-07 PopperType 4.5 1 4.5 36 3.2548e-05 Error 1.75 14 0.125 Total 22 17 Properties, Methods
% Get a table containing the mean squares values
tbl = stats(aov)
tbl = 4×5 table
SumOfSquares DF MeanSquares F pValue ____________ __ ___________ ___ __________ Brand 15.75 2 7.875 63 1e-07 PopperType 4.5 1 4.5 36 3.2548e-05 Error 1.75 14 0.125 Total 22 17
% To get a similar table without the object, you can use anova2
anova2(popcorn, 3)
ans = 1×3
0.0000 0.0001 0.7462
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>

Community Treasure Hunt

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

Start Hunting!