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.

52 2 Presenting <strong>and</strong> Summarising the Data<br />

represent the probability density estimate for a given bin. We can list de densities<br />

of PRT as follows:<br />

> h$density<br />

[1] 1.333333e-04 1.033333e-03 1.166667e-03<br />

[4] 9.666667e-04 5.666667e-04 4.666667e-04<br />

[7] 4.333333e-04 2.000000e-04 3.333333e-05<br />

Thus, using the formula previously mentioned for the probability density<br />

estimates, we compute the relative frequencies using the bin length (200 in our<br />

case) as follows:<br />

> h$density*200<br />

[1] 0.026666661 0.206666667 0.233333333 0.193333333<br />

[5] 0.113333333 0.093333333 0.086666667 0.040000000<br />

[9] 0.006666667<br />

2.2.3 Multivariate Tables, Scatter Plots <strong>and</strong> 3D Plots<br />

Multivariate tables display the frequencies of multivariate data. Figure 2.19 shows<br />

the format of a bivariate table displaying the counts nij corresponding to the several<br />

combinations of categories of two r<strong>and</strong>om variables. Such a bivariate table is<br />

called a cross table or contingency table.<br />

When dealing with continuous variables, one can also build cross tables using<br />

categories in accordance to the bins that would be assigned to a histogram<br />

representation of the variables.<br />

y 1<br />

. . .<br />

x 1<br />

n 11<br />

n 21<br />

n 12<br />

n 22<br />

. . .<br />

. . .<br />

. . .<br />

n 1c<br />

n 2c<br />

. . . . . . . . . . . .<br />

nr1 nr2 . . . nrc rr c . . .<br />

1 c2 cc Figure 2.19. An r×c contingency table with the observed absolute frequencies<br />

(counts nij). The row <strong>and</strong> column totals are ri <strong>and</strong> cj, respectively.<br />

Example 2.3<br />

y 2<br />

y r<br />

x 2<br />

Q: Consider the variables SEX <strong>and</strong> Q4 (4 th enquiry question) of the Freshmen<br />

dataset (see Appendix E). Determine the cross table for these two categorical<br />

variables.<br />

x c<br />

r 1<br />

r 2<br />

. . .

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

Saved successfully!

Ooh no, something went wrong!