STATISTICAL COMPUTING ACTIVITY: CORRESPONDENCE ANALYSIS

 

The contingency table could be entered a in a matrix form. We will use ³the influence of age on relationships with boyfriends² data given in Table 4.1, that is

 

 

Age Group

 

1

2

3

4

5

No boyfriend

21

21

14

13

8

Boyfriend/no sex

8

9

6

8

2

Boyfriend/sex

2

3

4

10

10

 

Entering the contingency table into R

 

>No_bf=c(21,21,14,13,8); Bf_nosex=c(8,9,6,8,2); Bf_sex=c(2,3,4,10,10)

>boyfriend=rbind(No_bf,Bf_nosex,Bf_sex)

>colnames(boyfriend)=c(³Age1², ³Age2², ³Age3², ³Age4², ³Age5²)

>boyfriend

 

We need to load a package

Ø     Packages

o      Load

§       MASS

·       OK

 

To carry out the correspondence analysis

 


>corresp(boyfriend, nf=2)

>biplot(corresp(boyfriend, nf=2))

 

Also try

>corresp(boyfriend, nf=1)

>plot(corresp(boyfriend, nf=1))

 

Compare the plots.


 

STATISTICAL COMPUTING ACTIVITY: CORRESPONDENCE ANALYSIS

 

Step 1. Run SYSTAT

File

            New

                        Data

 

Double click on (VAR0001) and rename it boyfriend. Double Click on (VAR0002) rename it age. Double click on (VAR0003) rename it freq.

Enter the data as follows

boyfriend

age

freq

noboy

A1

21

noboy

A2

21

noboy

A3

14

noboy

A4

13

noboy

A5

8

boynosex

A1

8

boynosex

A2

9

boynosex

A3

6

boynosex

A4

8

boynosex

A5

2

boysex

A1

2

boysex

A2

3

boysex

A3

4

boysex

A4

10

boysex

A5

10

 

Specify that the thirs variable is frequency

Data

Frequency

 

Select Freq.

 

 

Analysis

            Multivariate Analysis

                        Correspondence Analysis

Select the dependent and independent variables