Hypothesistestlargesample

.m
School
University of Melbourne **We aren't endorsed by this school
Course
MCEN 90011
Subject
Industrial Engineering
Date
May 29, 2023
Pages
1
Uploaded by LieutenantGalaxy10486 on coursehero.com
% Hypothesis testing (large sample normal test) % T05-Q1: air filter % H0: mu >= 40 vs H1: mu < 40 clear all; clc; n = 100; %sample size x_bar = 49000; %sample mean mu_0 = 50000; %test mean S = 4000; %sample standard deviation stderror = S/sqrt(n); z = (x_bar-mu_0)/stderror; side = 'left'; if strcmp(side,'both') display('Two tailed test'); display('Graph is showing one side instead of two-sided, hence it is showing p/2'); normspec([-inf -abs(z)],0,1); p = 2*normcdf(-abs(z)); elseif strcmp(side,'left') display('Left tail test'); normspec([-inf -abs(z)],0,1); p = normcdf(-abs(z)); else display('Right tail test'); normspec([abs(z) inf],0,1); p = 1-normcdf(abs(z)); end alpha = 0.05; if p > alpha display(p); display(alpha); display('Since p > alpha, Do not reject H_0'); else display('Since p <= alpha, Reject H_0'); end
Page1of 1
Uploaded by LieutenantGalaxy10486 on coursehero.com