Appendix E

R Run and Results As Is: Correlation and Histogram Tables at the End

R version 2.7.1 (2008-06-23)
Copyright (C) 2008 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

[Previously saved workspace restored]

> datafilename <- "RData.csv"
> person.data <- read.table(datafilename,header=TRUE,sep=",") 
> names(person.data) #list the names of the variables
[1] "J.1" "J.2" "J.3" "J.4" "J.5" "J.6" "J.7" "J.8" "Age" "Gender"
> V <-person.data
> V.sub <- subset(V, select = J.1:J.8 ) # Selecting data
> Vz <- scale(V.sub,scale=T) # Extracting z-scale
> Vq <- cbind(XM=Vz[,2], NM=Vz[,1], XF=Vz[,4], NF=Vz[,3], XS=Vz[,6], NS=Vz[,5], XP=Vz[,8], NP=Vz[,7]) # Defining drives
> agec <- subset(V, select = Gender:Age )
> Vx <- cbind(Vq, agec) # Re-attaching age identifier


> Vx.Fem <- subset(Vx, Gender == 1 , select = XM:Age ) # selecting Female group
> Vx.Mal <- subset(Vx, Gender == 2 , select = XM:Age ) # selecting Male group

> Vx.15 <- subset(Vx, Age == 15 , select = XM:NP ) # Defining matrix with all under 15 scores
> Vx.15.Msd <- c(sd((Vx.15[,"XM"]+Vx.15[,"NM"])*0.5000), sd((Vx.15[,"XF"]+Vx.15[,"NF"])*0.5000), sd((Vx.15[,"XS"]+Vx.15[,"NS"])*0.5000), sd((Vx.15[,"XP"]+Vx.15[,"NP"])*0.5000)) # Finding motivational sd's for under 15

> Vx.Fem.15 <- subset(Vx.Fem, Age == 15 , select = XM:NP ) # selecting age group Under 15
> Vx.Fem.15.SDM <- c(sd((Vx.Fem.15[,"XM"]+Vx.Fem.15[,"NM"])*0.5000), sd((Vx.Fem.15[,"XF"]+Vx.Fem.15[,"NF"])*0.5000), sd((Vx.Fem.15[,"XS"]+Vx.Fem.15[,"NS"])*0.5000), sd((Vx.Fem.15[,"XP"]+Vx.Fem.15[,"NP"])*0.5000)) # Finding Motivation sd's for under 15 females

> Vx.Fem.15.SD <- c(sd(Vx.Fem.15[,"XM"]-Vx.Fem.15[,"NM"]), sd(Vx.Fem.15[,"XF"]-Vx.Fem.15[,"NF"]), sd(Vx.Fem.15[,"XS"]-Vx.Fem.15[,"NS"]), sd(Vx.Fem.15[,"XP"]-Vx.Fem.15[,"NP"])) # Finding cognitive sd's for under 15 Females
> Vx.Fem.15 <- mean(Vx.Fem.15)
> Vx.Fem.15 <- round(Vx.Fem.15,2)
> Vx.Mal.15 <- subset(Vx.Mal, Age == 15 , select = XM:NP ) # selecting age group Under 15
> Vx.Mal.15.SDM <- c(sd((Vx.Mal.15[,"XM"]+Vx.Mal.15[,"NM"])*0.5000), sd((Vx.Mal.15[,"XF"]+Vx.Mal.15[,"NF"])*0.5000), sd((Vx.Mal.15[,"XS"]+Vx.Mal.15[,"NS"])*0.5000), sd((Vx.Mal.15[,"XP"]+Vx.Mal.15[,"NP"])*0.5000)) # Finding Motivation sd's for under 15 males

> Vx.Mal.15.SD <- c(sd(Vx.Mal.15[,"XM"]-Vx.Mal.15[,"NM"]), sd(Vx.Mal.15[,"XF"]-Vx.Mal.15[,"NF"]), sd(Vx.Mal.15[,"XS"]-Vx.Mal.15[,"NS"]), sd(Vx.Mal.15[,"XP"]-Vx.Mal.15[,"NP"])) # Finding cognitive sd's for under 15 Males
> Vx.Mal.15 <- mean(Vx.Mal.15)
> Vx.Mal.15 <- round(Vx.Mal.15,2)

> Vx.16 <- subset(Vx, Age == 16 , select = XM:NP ) # Defining matrix with all 16-25 scores
> Vx.16.Msd <- c(sd((Vx.16[,"XM"]+Vx.16[,"NM"])*0.5000), sd((Vx.16[,"XF"]+Vx.16[,"NF"])*0.5000), sd((Vx.16[,"XS"]+Vx.16[,"NS"])*0.5000), sd((Vx.16[,"XP"]+Vx.16[,"NP"])*0.5000)) # Finding motivational sd's for 16-25

> Vx.Fem.16 <- subset(Vx.Fem, Age == 16 , select = XM:NP ) # selecting age group 16-25
> Vx.Fem.16.SDM <- c(sd((Vx.Fem.16[,"XM"]+Vx.Fem.16[,"NM"])*0.5000), sd((Vx.Fem.16[,"XF"]+Vx.Fem.16[,"NF"])*0.5000), sd((Vx.Fem.16[,"XS"]+Vx.Fem.16[,"NS"])*0.5000), sd((Vx.Fem.16[,"XP"]+Vx.Fem.16[,"NP"])*0.5000)) # Finding Motivation sd's for 16-25 females

> Vx.Fem.16.SD <- c(sd(Vx.Fem.16[,"XM"]-Vx.Fem.16[,"NM"]), sd(Vx.Fem.16[,"XF"]-Vx.Fem.16[,"NF"]), sd(Vx.Fem.16[,"XS"]-Vx.Fem.16[,"NS"]), sd(Vx.Fem.16[,"XP"]-Vx.Fem.16[,"NP"])) # Finding cognitive sd's for 16-25 Females
> Vx.Fem.16 <- mean(Vx.Fem.16)
> Vx.Fem.16 <- round(Vx.Fem.16,2)
> Vx.Mal.16 <- subset(Vx.Mal, Age == 16 , select = XM:NP ) # selecting age group 16-25
> Vx.Mal.16.SDM <- c(sd((Vx.Mal.16[,"XM"]+Vx.Mal.16[,"NM"])*0.5000), sd((Vx.Mal.16[,"XF"]+Vx.Mal.16[,"NF"])*0.5000), sd((Vx.Mal.16[,"XS"]+Vx.Mal.16[,"NS"])*0.5000), sd((Vx.Mal.16[,"XP"]+Vx.Mal.16[,"NP"])*0.5000)) # Finding Motivation sd's for 16-25 males

> Vx.Mal.16.SD <- c(sd(Vx.Mal.16[,"XM"]-Vx.Mal.16[,"NM"]), sd(Vx.Mal.16[,"XF"]-Vx.Mal.16[,"NF"]), sd(Vx.Mal.16[,"XS"]-Vx.Mal.16[,"NS"]), sd(Vx.Mal.16[,"XP"]-Vx.Mal.16[,"NP"])) # Finding cognitive sd's for 16-25 Males
> Vx.Mal.16 <- mean(Vx.Mal.16)
> Vx.Mal.16 <- round(Vx.Mal.16,2)

> Vx.26 <- subset(Vx, Age == 26 , select = XM:NP ) # Defining matrix with all 26-35 scores
> Vx.26.Msd <- c(sd((Vx.26[,"XM"]+Vx.26[,"NM"])*0.5000), sd((Vx.26[,"XF"]+Vx.26[,"NF"])*0.5000), sd((Vx.26[,"XS"]+Vx.26[,"NS"])*0.5000), sd((Vx.26[,"XP"]+Vx.26[,"NP"])*0.5000)) # Finding motivational sd's for 26-35

> Vx.Fem.26 <- subset(Vx.Fem, Age == 26 , select = XM:NP ) # selecting age group 26-35
> Vx.Fem.26.SDM <- c(sd((Vx.Fem.26[,"XM"]+Vx.Fem.26[,"NM"])*0.5000), sd((Vx.Fem.26[,"XF"]+Vx.Fem.26[,"NF"])*0.5000), sd((Vx.Fem.26[,"XS"]+Vx.Fem.26[,"NS"])*0.5000), sd((Vx.Fem.26[,"XP"]+Vx.Fem.26[,"NP"])*0.5000)) # Finding Motivation sd's for 26-35 females

> Vx.Fem.26.SD <- c(sd(Vx.Fem.26[,"XM"]-Vx.Fem.26[,"NM"]), sd(Vx.Fem.26[,"XF"]-Vx.Fem.26[,"NF"]), sd(Vx.Fem.26[,"XS"]-Vx.Fem.26[,"NS"]), sd(Vx.Fem.26[,"XP"]-Vx.Fem.26[,"NP"])) # Finding cognitive sd's for 26-35 Females
> Vx.Fem.26 <- mean(Vx.Fem.26)
> Vx.Fem.26 <- round(Vx.Fem.26,2)
> Vx.Mal.26 <- subset(Vx.Mal, Age == 26 , select = XM:NP ) # selecting age group 26-35
> Vx.Mal.26.SDM <- c(sd((Vx.Mal.26[,"XM"]+Vx.Mal.26[,"NM"])*0.5000), sd((Vx.Mal.26[,"XF"]+Vx.Mal.26[,"NF"])*0.5000), sd((Vx.Mal.26[,"XS"]+Vx.Mal.26[,"NS"])*0.5000), sd((Vx.Mal.26[,"XP"]+Vx.Mal.26[,"NP"])*0.5000)) # Finding Motivation sd's for 26-35 males

> Vx.Mal.26.SD <- c(sd(Vx.Mal.26[,"XM"]-Vx.Mal.26[,"NM"]), sd(Vx.Mal.26[,"XF"]-Vx.Mal.26[,"NF"]), sd(Vx.Mal.26[,"XS"]-Vx.Mal.26[,"NS"]), sd(Vx.Mal.26[,"XP"]-Vx.Mal.26[,"NP"])) # Finding cognitive sd's for 26-35 Males
> Vx.Mal.26 <- mean(Vx.Mal.26)
> Vx.Mal.26 <- round(Vx.Mal.26,2)

> Vx.36 <- subset(Vx, Age == 36 , select = XM:NP ) # Defining matrix with all 36-45 scores
> Vx.36.Msd <- c(sd((Vx.36[,"XM"]+Vx.36[,"NM"])*0.5000), sd((Vx.36[,"XF"]+Vx.36[,"NF"])*0.5000), sd((Vx.36[,"XS"]+Vx.36[,"NS"])*0.5000), sd((Vx.36[,"XP"]+Vx.36[,"NP"])*0.5000)) # Finding motivational sd's for 36-45


> Vx.Fem.36 <- subset(Vx.Fem, Age == 36 , select = XM:NP ) # selecting age group 36-45
> Vx.Fem.36.SDM <- c(sd((Vx.Fem.36[,"XM"]+Vx.Fem.36[,"NM"])*0.5000), sd((Vx.Fem.36[,"XF"]+Vx.Fem.36[,"NF"])*0.5000), sd((Vx.Fem.36[,"XS"]+Vx.Fem.36[,"NS"])*0.5000), sd((Vx.Fem.36[,"XP"]+Vx.Fem.36[,"NP"])*0.5000)) # Finding Motivation sd's for 36-45 females

> Vx.Fem.36.SD <- c(sd(Vx.Fem.36[,"XM"]-Vx.Fem.36[,"NM"]), sd(Vx.Fem.36[,"XF"]-Vx.Fem.36[,"NF"]), sd(Vx.Fem.36[,"XS"]-Vx.Fem.36[,"NS"]), sd(Vx.Fem.36[,"XP"]-Vx.Fem.36[,"NP"])) # Finding cognitive sd's for 36-45 Females
> Vx.Fem.36 <- mean(Vx.Fem.36)
> Vx.Fem.36 <- round(Vx.Fem.36,2)
> Vx.Mal.36 <- subset(Vx.Mal, Age == 36 , select = XM:NP ) # selecting age group 36-45
> Vx.Mal.36.SDM <- c(sd((Vx.Mal.36[,"XM"]+Vx.Mal.36[,"NM"])*0.5000), sd((Vx.Mal.36[,"XF"]+Vx.Mal.36[,"NF"])*0.5000), sd((Vx.Mal.36[,"XS"]+Vx.Mal.36[,"NS"])*0.5000), sd((Vx.Mal.36[,"XP"]+Vx.Mal.36[,"NP"])*0.5000)) # Finding Motivation sd's for 36-45 males

> Vx.Mal.36.SD <- c(sd(Vx.Mal.36[,"XM"]-Vx.Mal.36[,"NM"]), sd(Vx.Mal.36[,"XF"]-Vx.Mal.36[,"NF"]), sd(Vx.Mal.36[,"XS"]-Vx.Mal.36[,"NS"]), sd(Vx.Mal.36[,"XP"]-Vx.Mal.36[,"NP"])) # Finding cognitive sd's for 36-45 Males
> Vx.Mal.36 <- mean(Vx.Mal.36)
> Vx.Mal.36 <- round(Vx.Mal.36,2)

> Vx.46 <- subset(Vx, Age == 46 , select = XM:NP ) # Defining matrix with all 46-55 scores
> Vx.46.Msd <- c(sd((Vx.46[,"XM"]+Vx.46[,"NM"])*0.5000), sd((Vx.46[,"XF"]+Vx.46[,"NF"])*0.5000), sd((Vx.46[,"XS"]+Vx.46[,"NS"])*0.5000), sd((Vx.46[,"XP"]+Vx.46[,"NP"])*0.5000)) # Finding motivational sd's for 46-55

> Vx.Fem.46 <- subset(Vx.Fem, Age == 46 , select = XM:NP ) # selecting age group 46-55
> Vx.Fem.46.SDM <- c(sd((Vx.Fem.46[,"XM"]+Vx.Fem.46[,"NM"])*0.5000), sd((Vx.Fem.46[,"XF"]+Vx.Fem.46[,"NF"])*0.5000), sd((Vx.Fem.46[,"XS"]+Vx.Fem.46[,"NS"])*0.5000), sd((Vx.Fem.46[,"XP"]+Vx.Fem.46[,"NP"])*0.5000)) # Finding Motivation sd's for 46-55 females

> Vx.Fem.46.SD <- c(sd(Vx.Fem.46[,"XM"]-Vx.Fem.46[,"NM"]), sd(Vx.Fem.46[,"XF"]-Vx.Fem.46[,"NF"]), sd(Vx.Fem.46[,"XS"]-Vx.Fem.46[,"NS"]), sd(Vx.Fem.46[,"XP"]-Vx.Fem.46[,"NP"])) # Finding cognitive sd's for 46-55 Females
> Vx.Fem.46 <- mean(Vx.Fem.46)
> Vx.Fem.46 <- round(Vx.Fem.46,2)
> Vx.Mal.46 <- subset(Vx.Mal, Age == 46 , select = XM:NP ) # selecting age group 46-55
> Vx.Mal.46.SDM <- c(sd((Vx.Mal.46[,"XM"]+Vx.Mal.46[,"NM"])*0.5000), sd((Vx.Mal.46[,"XF"]+Vx.Mal.46[,"NF"])*0.5000), sd((Vx.Mal.46[,"XS"]+Vx.Mal.46[,"NS"])*0.5000), sd((Vx.Mal.46[,"XP"]+Vx.Mal.46[,"NP"])*0.5000)) # Finding Motivation sd's for 46-55 males

> Vx.Mal.46.SD <- c(sd(Vx.Mal.46[,"XM"]-Vx.Mal.46[,"NM"]), sd(Vx.Mal.46[,"XF"]-Vx.Mal.46[,"NF"]), sd(Vx.Mal.46[,"XS"]-Vx.Mal.46[,"NS"]), sd(Vx.Mal.46[,"XP"]-Vx.Mal.46[,"NP"])) # Finding cognitive sd's for 46-55 Males
> Vx.Mal.46 <- mean(Vx.Mal.46)
> Vx.Mal.46 <- round(Vx.Mal.46,2)

> Vx.56 <- subset(Vx, Age == 56 , select = XM:NP ) # Defining matrix with all over 55 scores

> Vx.56.Msd <- c(sd((Vx.56[,"XM"]+Vx.56[,"NM"])*0.5000), sd((Vx.56[,"XF"]+Vx.56[,"NF"])*0.5000), sd((Vx.56[,"XS"]+Vx.56[,"NS"])*0.5000), sd((Vx.56[,"XP"]+Vx.56[,"NP"])*0.5000)) # Finding motivational sd's for over 55

> Vx.Fem.56 <- subset(Vx.Fem, Age == 56 , select = XM:NP ) # selecting age group Over 55
> Vx.Fem.56.SDM <- c(sd((Vx.Fem.56[,"XM"]+Vx.Fem.56[,"NM"])*0.5000), sd((Vx.Fem.56[,"XF"]+Vx.Fem.56[,"NF"])*0.5000), sd((Vx.Fem.56[,"XS"]+Vx.Fem.56[,"NS"])*0.5000), sd((Vx.Fem.56[,"XP"]+Vx.Fem.56[,"NP"])*0.5000)) # Finding Motivation sd's for over 55 females

> Vx.Fem.56.SD <- c(sd(Vx.Fem.56[,"XM"]-Vx.Fem.56[,"NM"]), sd(Vx.Fem.56[,"XF"]-Vx.Fem.56[,"NF"]), sd(Vx.Fem.56[,"XS"]-Vx.Fem.56[,"NS"]), sd(Vx.Fem.56[,"XP"]-Vx.Fem.56[,"NP"])) # Finding cognitive sd's for over 55 Females
> Vx.Fem.56 <- mean(Vx.Fem.56)
> Vx.Fem.56 <- round(Vx.Fem.56,2)
> Vx.Mal.56 <- subset(Vx.Mal, Age == 56 , select = XM:NP ) # selecting age group Over 55
> Vx.Mal.56.SDM <- c(sd((Vx.Mal.56[,"XM"]+Vx.Mal.56[,"NM"])*0.5000), sd((Vx.Mal.56[,"XF"]+Vx.Mal.56[,"NF"])*0.5000), sd((Vx.Mal.56[,"XS"]+Vx.Mal.56[,"NS"])*0.5000), sd((Vx.Mal.56[,"XP"]+Vx.Mal.56[,"NP"])*0.5000)) # Finding Motivation sd's for over 55 males

> Vx.Mal.56.SD <- c(sd(Vx.Mal.56[,"XM"]-Vx.Mal.56[,"NM"]), sd(Vx.Mal.56[,"XF"]-Vx.Mal.56[,"NF"]), sd(Vx.Mal.56[,"XS"]-Vx.Mal.56[,"NS"]), sd(Vx.Mal.56[,"XP"]-Vx.Mal.56[,"NP"])) # Finding cognitive sd's for over 55 Males
> Vx.Mal.56 <- mean(Vx.Mal.56)
> Vx.Mal.56 <- round(Vx.Mal.56,2)

> maleAge <- c(Vx.Mal.15, Vx.Mal.16, Vx.Mal.26, Vx.Mal.36, Vx.Mal.46, Vx.Mal.56)
> femAge <- c(Vx.Fem.15, Vx.Fem.16, Vx.Fem.26, Vx.Fem.36, Vx.Fem.46, Vx.Fem.56)
> r2 <- as.factor(rep(1:8,6))
> r1 <- as.factor(rep(rep(1:6,rep(8,6)),1))
> r3 <- as.factor(rep(1:2,24))
> r4 <- as.factor(rep(1:1,48))
> ageGroups <- data.frame(cbind(Male=as.vector(maleAge), Female=as.vector(femAge), Ages=0.5000*(as.vector(maleAge)+as.vector(femAge)), Drive=r2, Agg=r1, Cogn=r3, Dumy=r4 ))
> ageGroups
Male Female Ages Drive Agg Cogn Dumy
1 0.03 -0.64 -0.305 1 1 1 1
2 -0.21 -0.73 -0.470 2 1 2 1
3 0.00 -0.41 -0.205 3 1 1 1
4 0.01 -0.43 -0.210 4 1 2 1
5 -0.47 -0.67 -0.570 5 1 1 1
6 -0.35 -0.69 -0.520 6 1 2 1
7 -0.20 -0.80 -0.500 7 1 1 1
8 -0.46 -0.80 -0.630 8 1 2 1
9 0.08 -0.03 0.025 1 2 1 1
10 -0.02 -0.06 -0.040 2 2 2 1
11 0.01 0.05 0.030 3 2 1 1
12 0.03 0.07 0.050 4 2 2 1
13 -0.10 0.01 -0.045 5 2 1 1
14 0.08 -0.01 0.035 6 2 2 1
15 0.01 -0.09 -0.040 7 2 1 1
16 -0.06 -0.09 -0.075 8 2 2 1
17 0.23 -0.13 0.050 1 3 1 1
18 0.21 -0.20 0.005 2 3 2 1
19 0.17 -0.01 0.080 3 3 1 1
20 0.14 -0.14 0.000 4 3 2 1
21 0.20 -0.04 0.080 5 3 1 1
22 0.36 -0.12 0.120 6 3 2 1
23 0.13 -0.10 0.015 7 3 1 1
24 0.08 -0.09 -0.005 8 3 2 1
25 0.13 -0.18 -0.025 1 4 1 1
26 0.16 -0.11 0.025 2 4 2 1
27 0.06 -0.29 -0.115 3 4 1 1
28 -0.04 -0.15 -0.095 4 4 2 1
29 -0.01 -0.17 -0.090 5 4 1 1
30 -0.04 -0.38 -0.210 6 4 2 1
31 0.12 -0.19 -0.035 7 4 1 1
32 0.22 -0.24 -0.010 8 4 2 1
33 0.17 -0.06 0.055 1 5 1 1
34 0.27 -0.12 0.075 2 5 2 1
35 0.26 -0.19 0.035 3 5 1 1
36 0.28 -0.10 0.090 4 5 2 1
37 0.29 0.31 0.300 5 5 1 1
38 0.14 -0.10 0.020 6 5 2 1
39 0.39 -0.10 0.145 7 5 1 1
40 0.45 0.22 0.335 8 5 2 1
41 0.26 -0.25 0.005 1 6 1 1
42 0.29 -0.05 0.120 2 6 2 1
43 0.30 -0.82 -0.260 3 6 1 1
44 0.15 -0.42 -0.135 4 6 2 1
45 0.35 0.06 0.205 5 6 1 1
46 0.29 -0.01 0.140 6 6 2 1
47 0.48 0.06 0.270 7 6 1 1
48 0.46 0.15 0.305 8 6 2 1

> ctab1 <- tapply(ageGroups[,3],list(ageGroups[,4],ageGroups[,5]),mean)

> # FemPref <- tapply(ageGroups[,2],list(ageGroups[,7],ageGroups[,6]),mean)
> FemPref <- tapply(ageGroups[,2],list(ageGroups[,4],ageGroups[,5]),mean)
> FemPref # Female Pref Means
1 2 3 4 5 6
1 -0.64 -0.03 -0.13 -0.18 -0.06 -0.25
2 -0.73 -0.06 -0.20 -0.11 -0.12 -0.05
3 -0.41 0.05 -0.01 -0.29 -0.19 -0.82
4 -0.43 0.07 -0.14 -0.15 -0.10 -0.42
5 -0.67 0.01 -0.04 -0.17 0.31 0.06
6 -0.69 -0.01 -0.12 -0.38 -0.10 -0.01
7 -0.80 -0.09 -0.10 -0.19 -0.10 0.06
8 -0.80 -0.09 -0.09 -0.24 0.22 0.15
> FemPref.Mot <- t(cbind(Emotn=(FemPref[1, ]+FemPref[2,]), Feedg=(FemPref[3, ]+FemPref[4, ]), SoSex=(FemPref[5, ]+FemPref[6, ]), Prntg=(FemPref[7, ]+FemPref[8, ]))) # Female Pref motivation means


> CFpm <- cbind(Emotn=(FemPref[1, ]-FemPref[2,]), Feedg=(FemPref[3, ]-FemPref[4, ]), SoSex=(FemPref[5, ]-FemPref[6, ]), Prntg=(FemPref[7, ]-FemPref[8, ]))
> CFpm # Cognitive Female mean
Emotn Feedg SoSex Prntg
1 0.09 0.02 0.02 0.00
2 0.03 -0.02 0.02 0.00
3 0.07 0.13 0.08 -0.01
4 -0.07 -0.14 0.21 0.05
5 0.06 -0.09 0.41 -0.32
6 -0.20 -0.40 0.07 -0.09

> #MalPref <- tapply(ageGroups[,1],list(ageGroups[,7],ageGroups[,6]),mean)
> MalPref <- tapply(ageGroups[,1],list(ageGroups[,4],ageGroups[,5]),mean)
> MalPref # Male Pref Means
1 2 3 4 5 6
1 0.03 0.08 0.23 0.13 0.17 0.26
2 -0.21 -0.02 0.21 0.16 0.27 0.29
3 0.00 0.01 0.17 0.06 0.26 0.30
4 0.01 0.03 0.14 -0.04 0.28 0.15
5 -0.47 -0.10 0.20 -0.01 0.29 0.35
6 -0.35 0.08 0.36 -0.04 0.14 0.29
7 -0.20 0.01 0.13 0.12 0.39 0.48
8 -0.46 -0.06 0.08 0.22 0.45 0.46
> MalPref.Mot <- t(cbind(Emotn=(MalPref[1, ]+MalPref[2,]), Feedg=(MalPref[3, ]+MalPref[4, ]), SoSex=(MalPref[5, ]+MalPref[6, ]), Prntg=(MalPref[7, ]+MalPref[8, ]))) # Male Pref motivation means

> CMpm <- cbind(Emotn=(MalPref[1, ]-MalPref[2, ]), Feedg=(MalPref[3, ]-MalPref[4, ]), SoSex=(MalPref[5, ]-MalPref[6, ]), Prntg=(MalPref[7, ]-MalPref[8, ]))
> CMpm # Cognitive Male means
Emotn Feedg SoSex Prntg
1 0.24 -0.01 -0.12 0.26
2 0.10 -0.02 -0.18 0.07
3 0.02 0.03 -0.16 0.05
4 -0.03 0.10 0.03 -0.10
5 -0.10 -0.02 0.15 -0.06
6 -0.03 0.15 0.06 0.02

> ctab1
1 2 3 4 5 6
1 -0.305 0.025 0.050 -0.025 0.055 0.005
2 -0.470 -0.040 0.005 0.025 0.075 0.120
3 -0.205 0.030 0.080 -0.115 0.035 -0.260
4 -0.210 0.050 0.000 -0.095 0.090 -0.135
5 -0.570 -0.045 0.080 -0.090 0.300 0.205
6 -0.520 0.035 0.120 -0.210 0.020 0.140
7 -0.500 -0.040 0.015 -0.035 0.145 0.270
8 -0.630 -0.075 -0.005 -0.010 0.335 0.305
> ctabu <- ctab1 
> ctabu <- cbind(Emotn=(ctabu[1, ]+ctabu[2, ]), Feedg=(ctabu[3, ]+ctabu[4, ]), SoSex=(ctabu[5, ]+ctabu[6, ]), Prntg=(ctabu[7, ]+ctabu[8, ])) # ctabu is age-group unscaled motivation means

> ctab1 <- scale(ctab1)
> ctab1
1 2 3 4 5 6
1 0.7384170 0.6873457 0.1480397 0.5981825 -0.6353000 -0.3847090
2 -0.2664391 -0.6873457 -0.8209474 1.2721909 -0.4700187 0.1955079
3 1.3474207 0.7930912 0.7940311 -0.6150327 -0.8005813 -1.7217306
4 1.3169705 1.2160731 -0.9286127 -0.3454293 -0.3460577 -1.0910601
5 -0.8754428 -0.7930912 0.7940311 -0.2780285 1.3893959 0.6243639
6 -0.5709410 0.8988367 1.6553530 -1.8956487 -0.9245422 0.2964152
7 -0.4491402 -0.6873457 -0.6056169 0.4633808 0.1084658 0.9523125
8 -1.2408450 -1.4275641 -1.0362779 0.8003850 1.6786381 1.1289003
attr(,"scaled:center")
1 2 3 4 5 6 
-0.426250 -0.007500 0.043125 -0.069375 0.131875 0.081250 
attr(,"scaled:scale")
1 2 3 4 5 6 
0.16420262 0.04728334 0.04644025 0.07418305 0.12100583 0.19820174 
> ctab2 <- t(ctab1)
> ctab3 <- cbind(Emotn=0.5000*(ctab2[,1]+ctab2[,2]), Feedg=0.5000*(ctab2[,3]+ctab2[,4]), SoSex=0.5000*(ctab2[,5]+ctab2[,6]), Prntg=0.5000*(ctab2[,7]+ctab2[,8]), cntr=rep(1:6, 1))
> ctab3
Emotn Feedg SoSex Prntg cntr
1 0.23598893 1.33219556 -0.72319188 -0.8449926 1
2 0.00000000 1.00458215 0.05287274 -1.0574549 2
3 -0.33645386 -0.06729077 1.22469205 -0.8209474 3
4 0.93518667 -0.48023099 -1.08683856 0.6318829 4
5 -0.55265933 -0.57331949 0.23242682 0.8935520 5
6 -0.09460058 -1.40639534 0.46038951 1.0406064 6
> ctab4 <- t(ctab3)
> ctab4
1 2 3 4 5 6
Emotn 0.2359889 0.00000000 -0.33645386 0.9351867 -0.5526593 -0.09460058
Feedg 1.3321956 1.00458215 -0.06729077 -0.4802310 -0.5733195 -1.40639534
SoSex -0.7231919 0.05287274 1.22469205 -1.0868386 0.2324268 0.46038951
Prntg -0.8449926 -1.05745490 -0.82094742 0.6318829 0.8935520 1.04060642
cntr 1.0000000 2.00000000 3.00000000 4.0000000 5.0000000 6.00000000

> summary(lm(ctab4[1,] ~ ctab4[5,])) # Emotion Linear Model

Call:
lm(formula = ctab4[1, ] ~ ctab4[5, ])

Residuals:
1 2 3 4 5 6 
0.05908 -0.11864 -0.39683 0.93308 -0.49651 0.01982 

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.23517 0.52921 0.444 0.68
ctab4[5, ] -0.05827 0.13589 -0.429 0.69

Residual standard error: 0.5685 on 4 degrees of freedom
Multiple R-squared: 0.04394, Adjusted R-squared: -0.1951 
F-statistic: 0.1838 on 1 and 4 DF, p-value: 0.6902 


> summary(lm(ctab4[2,] ~ ctab4[5,])) # Feeding Linear Model

Call:
lm(formula = ctab4[2, ] ~ ctab4[5, ])

Residuals:
1 2 3 4 5 6 
0.01825 0.22891 -0.30468 -0.17935 0.26584 -0.02897 

Coefficients:
Estimate Std. Error t value Pr(>|t|) 
(Intercept) 1.85222 0.23238 7.970 0.001343 ** 
ctab4[5, ] -0.53827 0.05967 -9.021 0.000836 ***
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1 

Residual standard error: 0.2496 on 4 degrees of freedom
Multiple R-squared: 0.9531, Adjusted R-squared: 0.9414 
F-statistic: 81.37 on 1 and 4 DF, p-value: 0.0008364 


> summary(lm(ctab4[4,] ~ ctab4[5,])) # Parenting Linear Model

Call:
lm(formula = ctab4[4, ] ~ ctab4[5, ])

Residuals:
1 2 3 4 5 6 
0.3765 -0.3141 -0.5557 0.4191 0.2026 -0.1284 

Coefficients:
Estimate Std. Error t value Pr(>|t|) 
(Intercept) -1.6996 0.4117 -4.128 0.0145 *
ctab4[5, ] 0.4781 0.1057 4.523 0.0106 *
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1 

Residual standard error: 0.4422 on 4 degrees of freedom
Multiple R-squared: 0.8364, Adjusted R-squared: 0.7955 
F-statistic: 20.45 on 1 and 4 DF, p-value: 0.01064 


> summary(lm(ctab4[3,1:3] ~ ctab4[5,1:3])) # SoSex Young Linear Model

Call:
lm(formula = ctab4[3, 1:3] ~ ctab4[5, 1:3])

Residuals:
1 2 3 
0.06596 -0.13192 0.06596 

Coefficients:
Estimate Std. Error t value Pr(>|t|) 
(Intercept) -1.7631 0.2468 -7.144 0.0885 .
ctab4[5, 1:3] 0.9739 0.1142 8.525 0.0743 .
---
Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1 

Residual standard error: 0.1616 on 1 degrees of freedom
Multiple R-squared: 0.9864, Adjusted R-squared: 0.9729 
F-statistic: 72.68 on 1 and 1 DF, p-value: 0.07434 


> summary(lm(ctab4[3,4:6] ~ ctab4[5,1:3])) # SoSex Old Linear Model

Call:
lm(formula = ctab4[3, 4:6] ~ ctab4[5, 1:3])

Residuals:
4 5 6 
-0.1819 0.3638 -0.1819 

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -1.6786 0.6805 -2.467 0.245
ctab4[5, 1:3] 0.7736 0.3150 2.456 0.246

Residual standard error: 0.4455 on 1 degrees of freedom
Multiple R-squared: 0.8578, Adjusted R-squared: 0.7155 
F-statistic: 6.03 on 1 and 1 DF, p-value: 0.2462 


> # Presentation processing
> ctabu <- t(ctabu)
> Vx.Fem.Mot <- cbind(Vx.Fem.15.SDM, Vx.Fem.16.SDM, Vx.Fem.26.SDM, Vx.Fem.36.SDM, Vx.Fem.46.SDM, Vx.Fem.56.SDM) # Female Motivation SD
> Vx.Mal.Mot <- cbind(Vx.Mal.15.SDM, Vx.Mal.16.SDM, Vx.Mal.26.SDM, Vx.Mal.36.SDM, Vx.Mal.46.SDM, Vx.Mal.56.SDM) # Male Motivation SD

> Vx.Msd <- cbind(Vx.15.Msd, Vx.16.Msd, Vx.26.Msd, Vx.36.Msd, Vx.46.Msd, Vx.56.Msd)
> Vx.CsdF <- cbind(Vx.Fem.15.SD, Vx.Fem.16.SD, Vx.Fem.26.SD, Vx.Fem.36.SD, Vx.Fem.46.SD, Vx.Fem.56.SD)
> Vx.CsdM <- cbind(Vx.Mal.15.SD, Vx.Mal.16.SD, Vx.Mal.26.SD, Vx.Mal.36.SD, Vx.Mal.46.SD, Vx.Mal.56.SD)
> CFM <- t(CFpm)
> CMM <- t(CMpm)

> ctab4 # Motivation humor age Mean values Scaled for age groups
1 2 3 4 5 6
Emotn 0.2359889 0.00000000 -0.33645386 0.9351867 -0.5526593 -0.09460058
Feedg 1.3321956 1.00458215 -0.06729077 -0.4802310 -0.5733195 -1.40639534
SoSex -0.7231919 0.05287274 1.22469205 -1.0868386 0.2324268 0.46038951
Prntg -0.8449926 -1.05745490 -0.82094742 0.6318829 0.8935520 1.04060642
cntr 1.0000000 2.00000000 3.00000000 4.0000000 5.0000000 6.00000000

> ctabu # Motivation humor age Mean values unscaled for age groups SD computed
1 2 3 4 5 6
Emotn -0.775 -0.015 0.055 6.938894e-18 0.130 0.125
Feedg -0.415 0.080 0.080 -2.100000e-01 0.125 -0.395
SoSex -1.090 -0.010 0.200 -3.000000e-01 0.320 0.345
Prntg -1.130 -0.115 0.010 -4.500000e-02 0.480 0.575

> Vx.Msd # Motivation humor types age group Standard Deviations 
Vx.15.Msd Vx.16.Msd Vx.26.Msd Vx.36.Msd Vx.46.Msd Vx.56.Msd
[1,] 1.0107257 0.8441173 0.9713069 0.9645704 0.8608266 0.7323595
[2,] 0.8473756 0.9016989 0.9533032 0.9833829 0.8901610 0.9192562
[3,] 0.8109170 0.9417230 0.9301491 0.9966990 0.8106675 0.7556924
[4,] 0.8211666 0.8770109 0.9653394 0.9489153 0.9763407 0.8369785

> MalPref.Mot # Male Motivation Means
1 2 3 4 5 6
Emotn -0.18 0.06 0.44 0.29 0.44 0.55
Feedg 0.01 0.04 0.31 0.02 0.54 0.45
SoSex -0.82 -0.02 0.56 -0.05 0.43 0.64
Prntg -0.66 -0.05 0.21 0.34 0.84 0.94
> Vx.Mal.Mot # Male Motivation SD
Vx.Mal.15.SDM Vx.Mal.16.SDM Vx.Mal.26.SDM Vx.Mal.36.SDM Vx.Mal.46.SDM Vx.Mal.56.SDM
[1,] 1.1859272 0.8116202 1.0045298 0.8890683 0.8603701 0.6769898
[2,] 0.8743244 0.9709170 0.9208781 0.9415729 0.9349828 0.8994713
[3,] 0.9363035 0.9716868 0.9117006 0.9447914 0.8430817 0.7433659
[4,] 0.8887736 0.8405511 0.9440040 0.8198398 0.9638612 0.7770082

> FemPref.Mot # Female Motivation Means
1 2 3 4 5 6
Emotn -1.37 -0.09 -0.33 -0.29 -0.18 -0.30
Feedg -0.84 0.12 -0.15 -0.44 -0.29 -1.24
SoSex -1.36 0.00 -0.16 -0.55 0.21 0.05
Prntg -1.60 -0.18 -0.19 -0.43 0.12 0.21
> Vx.Fem.Mot # Female Motivation SD
Vx.Fem.15.SDM Vx.Fem.16.SDM Vx.Fem.26.SDM Vx.Fem.36.SDM Vx.Fem.46.SDM Vx.Fem.56.SDM
[1,] 0.8657435 0.8670724 0.9005360 1.034395 0.8529769 0.7606967
[2,] 0.8206227 0.8574180 0.9850330 1.027738 0.8084088 0.7096871
[3,] 0.7458324 0.9259143 0.9238660 1.049632 0.7920221 0.7660661
[4,] 0.7566053 0.9028007 0.9893694 1.050609 0.9798562 0.9019347

> CFM # Cognitive divides Female Means
1 2 3 4 5 6
Emotn 0.09 0.03 0.07 -0.07 0.06 -0.20
Feedg 0.02 -0.02 0.13 -0.14 -0.09 -0.40
SoSex 0.02 0.02 0.08 0.21 0.41 0.07
Prntg 0.00 0.00 -0.01 0.05 -0.32 -0.09

> Vx.CsdF # Cognitive divides Female Standard deviations
Vx.Fem.15.SD Vx.Fem.16.SD Vx.Fem.26.SD Vx.Fem.36.SD Vx.Fem.46.SD Vx.Fem.56.SD
[1,] 0.9335612 0.8222998 0.8046618 0.9176226 1.0428590 0.7418870
[2,] 0.5231201 0.7844552 0.8190234 0.7815483 0.9068011 0.6184870
[3,] 0.6615734 0.7713364 0.7145555 0.6700317 0.6290835 0.4786062
[4,] 0.5979262 0.8042974 0.8112000 0.6798709 0.5971244 0.6822790

> CMM # Cognitive divides Male Means
1 2 3 4 5 6
Emotn 0.24 0.10 0.02 -0.03 -0.10 -0.03
Feedg -0.01 -0.02 0.03 0.10 -0.02 0.15
SoSex -0.12 -0.18 -0.16 0.03 0.15 0.06
Prntg 0.26 0.07 0.05 -0.10 -0.06 0.02

> Vx.CsdM # Cognitive divides Male Standard deviations
Vx.Mal.15.SD Vx.Mal.16.SD Vx.Mal.26.SD Vx.Mal.36.SD Vx.Mal.46.SD Vx.Mal.56.SD
[1,] 0.9744725 1.0138135 0.9335796 0.5903462 0.8438384 1.0000008
[2,] 1.0739823 0.7435882 0.7352012 0.6281206 0.6094126 0.6688316
[3,] 0.7361448 0.6903084 0.8728658 0.7399339 0.7012244 0.7581183
[4,] 0.6035127 0.8330666 0.8956322 0.5830584 0.8712646 0.5729923

> matplot(t(ctab4[1:4,]))
>