01.03.2013 Views

Applied Statistics Using SPSS, STATISTICA, MATLAB and R

Applied Statistics Using SPSS, STATISTICA, MATLAB and R

Applied Statistics Using SPSS, STATISTICA, MATLAB and R

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

178 5 Non-Parametric Tests of Hypotheses<br />

data in a compact way, with a specific column containing the number of<br />

occurrences of each case.<br />

<br />

Comm<strong>and</strong>s 5.3. <strong>SPSS</strong>, <strong>STATISTICA</strong>, <strong>MATLAB</strong> <strong>and</strong> R comm<strong>and</strong>s used to<br />

perform the binomial test.<br />

<strong>SPSS</strong> Analyze; Nonparametric Tests; Binomial<br />

<strong>STATISTICA</strong><br />

<strong>Statistics</strong>; Basic <strong>Statistics</strong> <strong>and</strong> Tables;<br />

t-test, single sample<br />

<strong>MATLAB</strong> [h,sig,ci]=ttest(x,m,alpha,tail)<br />

R binom.test(x,n,p,conf.level=0.95)<br />

When performing the binomial test with <strong>STATISTICA</strong> or <strong>MATLAB</strong> using the<br />

single sample t test, a somewhat different value is obtained because no continuity<br />

correction is used <strong>and</strong> the st<strong>and</strong>ard deviation is estimated from pˆ . This difference<br />

is frequently of no importance. With <strong>MATLAB</strong> the test is performed as follows:<br />

» x = [ones(176,1); zeros(48,1)];<br />

» [h, sig, ci]=ttest(x,0.75,0.05,0)<br />

h =<br />

0<br />

sig =<br />

0.195<br />

ci =<br />

0.7316 0.8399<br />

Note that x is defined as a column vector filled in with 176 ones followed by 48<br />

zeros. The comm<strong>and</strong>s ones(m,n) <strong>and</strong> zeros(m,n) define matrices with m<br />

rows <strong>and</strong> n columns filled with ones <strong>and</strong> zeros, respectively. The notation [A; B]<br />

defines a matrix by juxtaposition of the matrices A <strong>and</strong> B side by side along the<br />

columns (along the rows when omitting the semicolon).<br />

The results of the test indicate that the null hypothesis cannot be rejected (h=0).<br />

The two-tailed significance is 0.195, somewhat lower than previously found<br />

(0.248), for the above mentioned reasons.<br />

The arguments x, n <strong>and</strong> p of the R binom.test function represent the<br />

number of successes, the number of trials <strong>and</strong> the tested value of p, respectively.<br />

Other details can be found with help(binom.test). For the Example 5.3 we<br />

run binom.test(176,176+48,0.75), obtaining a two-tailed significance of<br />

0.247, nearly the double of the value published in Table 5.3 as it should. A 95%<br />

confidence interval of [0.726, 0.838] is also published, containing the observed<br />

proportion of 0.786.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!