• Non ci sono risultati.

SOME SOLUTION 5.

N/A
N/A
Protected

Academic year: 2021

Condividi "SOME SOLUTION 5."

Copied!
1
0
0

Testo completo

(1)

SOME SOLUTION

5.

## read data as matrix lunch=matrix(c(

2829,433,394,431,401, 9201,1092,733,691,1256, 14764,877,531,337,1652,

14759,1119,71,42,319), byrow=T, ncol=5)

colnames(lunch)=c("home","canteen","rest","bar","work_pl") rownames(lunch)=c("Bachelor","A-level","GCSE","Primary") lunch

## margins -- sum of each row and column -- total margin.table(lunch,1);margin.table(lunch,2);sum(lunch)

## percent of the total

p_lunch=prop.table(lunch); round(p_lunch*100,1) barplot(p_lunch,beside=F)

## row profiles (percentage)

r_lunch=prop.table(lunch,1); round(r_lunch*100,1) par(mfrow=c(1,dim(r_lunch)[1]))

for (i in 1:dim(r_lunch)[1])

{ barplot(r_lunch[i,],ylim=c(0,1),main=rownames(lunch)[i]) abline(h=0) }

par(mfrow=c(1,1))

par(mfrow=c(1,dim(c_lunch)[2])) for (j in 1:dim(c_lunch)[2])

{ barplot(c_lunch[,j],ylim=c(0,0.5),main=colnames(lunch)[j]) abline(h=0) }

par(mfrow=c(1,1)

The barplots of row profiles have different forms, likewise for column profiles.

Column profiles show that home and canteen are preferred by people with low level of education, while having lunch at the working place is more frequent for people with medium level of education. Bar and restaurant have the same type of customer.

Similarly, Row profiles show that people with low level of education lunch at restaurant, bar and working place rarely.

6. 1. F – 2. V – 3. F – 4. V – 5. F – 6. F 7. A – C – D

E – D – A

1

Riferimenti

Documenti correlati

We allow for discontinuous coefficients and random initial condition and, under suitable assumptions, we prove that in the limit as the number of particles grows to infinity

Let E be the midpoint of AC, and let F be the midpoint

[r]

X is the amount won or lost and Y is the outcome of the

Some topics on modular functions, elliptic functions and transcendence theory. Sheet of

Dipartimento di Metodi e Modelli, Matematici per le Scienze Applicate, Universit` a di Roma “La Sapienza”,

[r]

Bevande Comprese 1 Bottiglia di vino doc Rosso o Bianco ogni 4 persone –1 bottiglia di acqua ogni 2 persone Caffè prezzo 42,50 euro +2,50 di servizio e. coperto