Data analysis of basic parenting values/attitudes survey, version 2.

1 Data preprocessing

Preliminaries.

## [1] "dplyr"   "langcog" "tidyr"   "ggplot2" "lme4"
## 
## Attaching package: 'langcog'
## 
## The following object is masked from 'package:base':
## 
##     scale
## 
## 
## Attaching package: 'dplyr'
## 
## The following objects are masked from 'package:plyr':
## 
##     arrange, count, desc, failwith, id, mutate, rename, summarise,
##     summarize
## 
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## 
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
## 
## 
## Attaching package: 'psych'
## 
## The following object is masked from 'package:ggplot2':
## 
##     %+%
## 
## Loading required package: MASS
## 
## Attaching package: 'MASS'
## 
## The following object is masked from 'package:dplyr':
## 
##     select
## 
## Loading required package: boot
## 
## Attaching package: 'boot'
## 
## The following object is masked from 'package:psych':
## 
##     logit
## 
## Loading required package: lattice
## 
## Attaching package: 'lattice'
## 
## The following object is masked from 'package:boot':
## 
##     melanoma
## 
## 
## Attaching package: 'nFactors'
## 
## The following object is masked from 'package:lattice':
## 
##     parallel

Read in files and consolidate to the same directory.

files <- dir("../production-results/e6/")
d.raw <- data.frame()

for (f in files) {
  jf <- paste("../production-results/e6/",f,sep="")
  jd <- fromJSON(paste(readLines(jf), collapse=""))
  
  # clean up instruction trial
  sent <- jd$answers$data$sentence
  rating <- as.numeric(jd$answers$data$rating) 
  trial_type <- jd$answer$data$trial_type
  sent <- sent[trial_type != "2afc_instructions"]
  trial_type <- trial_type[trial_type != "2afc_instructions"]
  
  #left out race because not sure yet how to deal with list format
  id <- data.frame(workerid = jd$WorkerId, 
                   sent = sent,
                   rating = rating,
                   children = jd$answers$data$children,
                   language = jd$answer$data$homelang,
                   ses = jd$answer$data$ladder,
                   gender = jd$answer$data$gender,
                   age = jd$answer$data$age,
                   education = jd$answer$data$education,
                   ethnicity = jd$answer$data$ethnicity,
                   childAgeYoung = jd$answer$data$childAgeYoung,
                   childAgeOld = jd$answer$data$childAgeOld
                   )
  d.raw <- bind_rows(d.raw, id)
}

Map on question short forms so that we can use these instead.

labels <- read.csv("sent_forms_e6.csv")
labels$sent <- as.character(labels$sent)

Clean up labels.

d.raw$sent <- as.character(d.raw$sent)
d.raw$sent <- str_replace_all(d.raw$sent, "'", "")
d.raw$sent <- str_replace_all(d.raw$sent, "’", "")
d.raw$sent <- str_replace_all(d.raw$sent, "“", "")
d.raw$sent <- str_replace_all(d.raw$sent, "”", "")
d.raw$sent <- str_replace_all(d.raw$sent, "‘", "")
d.raw$sent <- str_replace_all(d.raw$sent, "â", "")

Merge.

d <- left_join(d.raw, labels)

#set up reverse code variables so that items don't get reverse coded a second time. 

d$reverse_code[d$reverse_code == 1 & d$rating == "0"] <- 0
d$reverse_code[d$reverse_code == 1 & d$rating == "1"] <- 1
d$reverse_code[d$reverse_code == 1 & d$rating == "2"] <- 2

d$reverse_code[d$reverse_code == 1 & d$rating == "4"] <- 4
d$reverse_code[d$reverse_code == 1 & d$rating == "5"] <- 5
d$reverse_code[d$reverse_code == 1 & d$rating == "6"] <- 6

#reverse code.
d$rating[d$reverse_code == 0 & d$rating == "0"] <- 6
d$rating[d$reverse_code == 1 & d$rating == "1"] <- 5
d$rating[d$reverse_code == 2 & d$rating == "2"] <- 4

d$rating[d$reverse_code == 4 & d$rating == "4"] <- 2
d$rating[d$reverse_code == 5 & d$rating == "5"] <- 1
d$rating[d$reverse_code == 6 & d$rating == "6"] <- 0

Plot demographic info.

subinfo <- d %>% 
  group_by(workerid) %>%
  summarise(age = age[1],
            gender = gender[1],
            children = children[1],
            ses = ses[1],
            education = education[1],
            language = language[1], 
            ethnicity = ethnicity[1],
            youngestChildAge = childAgeYoung[1],
            oldestChildAge = childAgeOld[1]
            )

subinfo$education <- factor(subinfo$education, levels = c("highSchool","someCollege","4year","someGrad","Grad"))

subinfo$gender <- str_replace_all(subinfo$gender, "female|FEMALE|F$|f$|Femal$|Females|Females","Female")
subinfo$gender <- str_replace_all(subinfo$gender, "^male|^Male|^MALE|^M$|^m$|^Maleq|Make", "Male")
subinfo$gender <- str_replace_all(subinfo$gender, "29|24|25|28|32|33|45", "")
subinfo$gender <- str_replace_all(subinfo$gender, "males", "male")
subinfo$gender <- str_replace_all(subinfo$gender, " ", "")


subinfo$language <- str_replace_all(subinfo$language, "english|eNGLISH|Engliah|ENGLISH|^eng$|Enlgish", "English")
subinfo$language <- str_replace_all(subinfo$language," ", "")
subinfo$language <- str_replace_all(subinfo$language,"arabic", "Arabic")
subinfo$language <- str_replace_all(subinfo$language,"chinese", "Chinese")
subinfo$language <- str_replace_all(subinfo$language,"german", "German")
subinfo$language <- str_replace_all(subinfo$language,"tagalog", "Tagalog")

subinfo$youngestChildAge <- factor(subinfo$youngestChildAge, levels = c("","0to6mo","7to12mo","1y","2y","3y","4y","5y","6y","7y","8y","9y","10y","olderthan10"))

subinfo$oldestChildAge <- factor(subinfo$oldestChildAge, levels = c("","0to6mo","7to12mo","1y","2y","3y","4y","5y","6y","7y","8y","9y","10y","olderthan10"))

qplot(ses, data=subinfo)

qplot(children, data=subinfo)

qplot(gender, data=subinfo)

qplot(education, data=subinfo)

qplot(age, data=subinfo)

qplot(language, data=subinfo)

qplot(ethnicity, data=subinfo)

qplot(youngestChildAge, data=subinfo)

qplot(oldestChildAge, data=subinfo)

2 Basic analyses

Now look at mean ratings across sentences.

rating_count <- table(d$rating) 
rating_count
## 
##    0    1    2    3    4    5    6 
##  204  452  613 1406 1705 2155 3965
prop.table(rating_count) 
## 
##          0          1          2          3          4          5 
## 0.01942857 0.04304762 0.05838095 0.13390476 0.16238095 0.20523810 
##          6 
## 0.37761905
ms <- d %>%
  group_by(category, instrument, short_sent) %>%
  multi_boot_standard(col = "rating") %>%
  arrange(instrument, category, desc(mean)) 

ms$short_sent_ord <- factor(ms$short_sent, 
                             levels = ms$short_sent)

Plot attitude.

Ratings are clearly lower for the reverse coded items (the final 2 items in each category); this could be due to response sets (i.e., participants endorsing all items highly).

qplot(short_sent_ord, mean, col = category,
      ymin = ci_lower, ymax = ci_upper, 
      geom = "pointrange",
      data = filter(ms, instrument == "attitudes")) +
  theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = .5)) +
  xlab("") + 
  ylab("Mean Rating") + 
  ylim(c(0,6)) + 
  scale_colour_solarized()

3 Scale reliability

3.1 Whole Scale

This analysis is not especially meaningful as it averages across the three subscales. Raw alpha is .88 which is higher than previous runs.

wide.attitudes <- d %>% 
  filter(instrument == "attitudes") %>%
  select(workerid, short_sent, rating) %>% 
  spread(short_sent, rating)
alpha.mat <- as.matrix(select(wide.attitudes, -workerid))
alpha(x = alpha.mat)
## Some items ( rules prevent tantrums ) were negatively correlated with the total scale and probably should be reversed.  To do this, run the function again with the 'check.keys=TRUE' option
## 
## Reliability analysis   
## Call: alpha(x = alpha.mat)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N   ase mean  sd
##       0.89      0.91    0.94      0.19  10 0.012  4.5 0.6
## 
##  lower alpha upper     95% confidence boundaries
## 0.87 0.89 0.92 
## 
##  Reliability if an item is dropped:
##                                     raw_alpha std.alpha G6(smc) average_r
## can learn good and bad                   0.89      0.90    0.94      0.19
## children should be grateful              0.89      0.91    0.94      0.19
## control behavior                         0.89      0.91    0.94      0.20
## control emotions if comforted            0.89      0.91    0.94      0.20
## dont impose structure                    0.89      0.91    0.94      0.20
## dont interrupt                           0.89      0.91    0.94      0.20
## examples are good                        0.89      0.91    0.94      0.19
## follow-in good                           0.89      0.91    0.94      0.20
## give children comfort                    0.89      0.91    0.94      0.19
## holding and cradling                     0.89      0.90    0.94      0.19
## kids should not decide                   0.89      0.91    0.94      0.20
## learn before talking                     0.89      0.90    0.94      0.19
## learn by playing                         0.89      0.90    0.94      0.19
## learn contingencies                      0.89      0.91    0.94      0.19
## learn from other children                0.89      0.91    0.94      0.19
## learn from repetetive behaviors          0.89      0.91    0.94      0.19
## learn math before school                 0.89      0.90    0.94      0.19
## new experiences                          0.89      0.91    0.94      0.20
## nonsense games                           0.89      0.91    0.94      0.19
## not spoiled with too much attention      0.89      0.91    0.94      0.19
## parents choose toys                      0.89      0.91    0.94      0.19
## play freely                              0.89      0.91    0.94      0.19
## play pretend                             0.89      0.91    0.94      0.19
## play with friends                        0.89      0.91    0.94      0.19
## punish for small rules                   0.89      0.91    0.94      0.20
## punish misbehavior                       0.89      0.91    0.94      0.20
## reading before school                    0.89      0.91    0.94      0.19
## reading before speaking                  0.89      0.91    0.94      0.19
## reasons for rules                        0.89      0.91    0.94      0.19
## respect parents teachers                 0.89      0.91    0.94      0.19
## rules prevent tantrums                   0.90      0.91    0.94      0.20
## safe loving environment                  0.89      0.90    0.93      0.19
## simple toys                              0.89      0.91    0.94      0.20
## spontaneous play                         0.89      0.91    0.94      0.20
## strict rules                             0.89      0.91    0.94      0.19
## strong bond mom                          0.89      0.90    0.94      0.19
## talk about emotions                      0.89      0.90    0.93      0.19
## talk about feelings before mature        0.89      0.91    0.94      0.19
## talk about opinions                      0.89      0.91    0.94      0.19
## too much affection does not harm         0.89      0.91    0.94      0.19
## wait when told                           0.89      0.91    0.94      0.19
## worry about misbehavior                  0.89      0.91    0.94      0.19
##                                      S/N alpha se
## can learn good and bad               9.5    0.012
## children should be grateful          9.9    0.012
## control behavior                    10.0    0.012
## control emotions if comforted       10.2    0.012
## dont impose structure                9.9    0.012
## dont interrupt                      10.0    0.012
## examples are good                    9.6    0.012
## follow-in good                      10.0    0.012
## give children comfort                9.7    0.012
## holding and cradling                 9.4    0.012
## kids should not decide              10.0    0.012
## learn before talking                 9.5    0.012
## learn by playing                     9.5    0.012
## learn contingencies                  9.7    0.012
## learn from other children            9.9    0.012
## learn from repetetive behaviors      9.8    0.012
## learn math before school             9.5    0.012
## new experiences                     10.3    0.012
## nonsense games                       9.6    0.012
## not spoiled with too much attention  9.9    0.012
## parents choose toys                  9.9    0.012
## play freely                          9.8    0.012
## play pretend                         9.5    0.012
## play with friends                    9.7    0.012
## punish for small rules              10.1    0.012
## punish misbehavior                  10.3    0.012
## reading before school                9.6    0.012
## reading before speaking              9.6    0.012
## reasons for rules                    9.7    0.012
## respect parents teachers             9.6    0.012
## rules prevent tantrums              10.6    0.011
## safe loving environment              9.4    0.012
## simple toys                         10.1    0.012
## spontaneous play                    10.0    0.012
## strict rules                         9.9    0.012
## strong bond mom                      9.5    0.012
## talk about emotions                  9.4    0.013
## talk about feelings before mature    9.6    0.012
## talk about opinions                  9.6    0.012
## too much affection does not harm     9.7    0.012
## wait when told                       9.7    0.012
## worry about misbehavior              9.9    0.012
## 
##  Item statistics 
##                                       n  raw.r  std.r  r.cor r.drop mean
## can learn good and bad              250  0.628  0.660  0.657  0.604  5.3
## children should be grateful         250  0.394  0.407  0.394  0.344  4.5
## control behavior                    250  0.292  0.313  0.293  0.241  4.4
## control emotions if comforted       250  0.242  0.205  0.177  0.176  3.1
## dont impose structure               250  0.371  0.349  0.333  0.312  3.9
## dont interrupt                      250  0.320  0.320  0.304  0.269  4.2
## examples are good                   250  0.554  0.582  0.574  0.523  5.1
## follow-in good                      250  0.295  0.316  0.289  0.246  4.3
## give children comfort               250  0.508  0.526  0.512  0.475  5.1
## holding and cradling                250  0.672  0.689  0.688  0.646  5.2
## kids should not decide              250  0.356  0.334  0.313  0.300  3.9
## learn before talking                250  0.604  0.636  0.631  0.577  5.3
## learn by playing                    250  0.627  0.647  0.642  0.602  5.3
## learn contingencies                 250  0.510  0.537  0.528  0.477  5.0
## learn from other children           250  0.438  0.414  0.395  0.384  4.1
## learn from repetetive behaviors     250  0.466  0.477  0.462  0.423  4.6
## learn math before school            250  0.651  0.662  0.661  0.622  5.3
## new experiences                     250  0.153  0.135  0.097  0.089  2.9
## nonsense games                      250  0.584  0.586  0.577  0.549  4.8
## not spoiled with too much attention 250  0.415  0.381  0.369  0.350  3.5
## parents choose toys                 250  0.387  0.364  0.344  0.327  3.9
## play freely                         250  0.473  0.456  0.443  0.423  3.9
## play pretend                        250  0.620  0.626  0.620  0.588  5.0
## play with friends                   250  0.500  0.489  0.472  0.450  4.7
## punish for small rules              250  0.273  0.263  0.239  0.217  3.7
## punish misbehavior                  250  0.147  0.132  0.090  0.081  3.4
## reading before school               250  0.594  0.605  0.603  0.560  5.3
## reading before speaking             250  0.604  0.605  0.598  0.568  5.3
## reasons for rules                   250  0.546  0.534  0.521  0.501  4.8
## respect parents teachers            250  0.539  0.552  0.546  0.505  5.0
## rules prevent tantrums              250 -0.031 -0.057 -0.099 -0.102  2.4
## safe loving environment             250  0.682  0.712  0.715  0.665  5.6
## simple toys                         250  0.239  0.247  0.218  0.181  3.9
## spontaneous play                    250  0.330  0.340  0.314  0.282  4.4
## strict rules                        250  0.416  0.391  0.366  0.359  3.9
## strong bond mom                     250  0.610  0.638  0.635  0.586  5.4
## talk about emotions                 250  0.690  0.705  0.707  0.663  5.3
## talk about feelings before mature   250  0.612  0.609  0.604  0.577  5.0
## talk about opinions                 250  0.573  0.595  0.588  0.546  5.1
## too much affection does not harm    250  0.513  0.486  0.480  0.456  4.0
## wait when told                      250  0.464  0.484  0.473  0.425  4.8
## worry about misbehavior             250  0.391  0.382  0.361  0.338  4.3
##                                       sd
## can learn good and bad              0.98
## children should be grateful         1.45
## control behavior                    1.37
## control emotions if comforted       1.73
## dont impose structure               1.65
## dont interrupt                      1.40
## examples are good                   1.08
## follow-in good                      1.30
## give children comfort               1.06
## holding and cradling                1.14
## kids should not decide              1.56
## learn before talking                1.02
## learn by playing                    1.03
## learn contingencies                 1.07
## learn from other children           1.63
## learn from repetetive behaviors     1.35
## learn math before school            1.19
## new experiences                     1.62
## nonsense games                      1.29
## not spoiled with too much attention 1.89
## parents choose toys                 1.70
## play freely                         1.54
## play pretend                        1.23
## play with friends                   1.61
## punish for small rules              1.50
## punish misbehavior                  1.67
## reading before school               1.26
## reading before speaking             1.39
## reasons for rules                   1.54
## respect parents teachers            1.19
## rules prevent tantrums              1.79
## safe loving environment             0.78
## simple toys                         1.52
## spontaneous play                    1.31
## strict rules                        1.68
## strong bond mom                     0.94
## talk about emotions                 1.22
## talk about feelings before mature   1.35
## talk about opinions                 1.00
## too much affection does not harm    1.86
## wait when told                      1.19
## worry about misbehavior             1.51
## 
## Non missing response frequency for each item
##                                        0    1    2    3    4    5    6
## can learn good and bad              0.00 0.00 0.01 0.06 0.09 0.28 0.56
## children should be grateful         0.00 0.03 0.06 0.20 0.16 0.18 0.37
## control behavior                    0.00 0.03 0.05 0.20 0.20 0.24 0.27
## control emotions if comforted       0.08 0.13 0.15 0.24 0.18 0.11 0.11
## dont impose structure               0.03 0.07 0.10 0.17 0.23 0.18 0.22
## dont interrupt                      0.00 0.04 0.06 0.24 0.21 0.21 0.24
## examples are good                   0.00 0.01 0.01 0.08 0.13 0.29 0.48
## follow-in good                      0.00 0.03 0.06 0.18 0.24 0.28 0.20
## give children comfort               0.00 0.01 0.02 0.06 0.13 0.30 0.48
## holding and cradling                0.00 0.01 0.02 0.07 0.12 0.22 0.56
## kids should not decide              0.03 0.07 0.07 0.21 0.24 0.21 0.16
## learn before talking                0.00 0.01 0.01 0.04 0.12 0.20 0.62
## learn by playing                    0.00 0.00 0.02 0.06 0.13 0.22 0.57
## learn contingencies                 0.00 0.00 0.02 0.08 0.16 0.32 0.41
## learn from other children           0.04 0.04 0.07 0.17 0.24 0.18 0.27
## learn from repetetive behaviors     0.00 0.02 0.06 0.16 0.14 0.27 0.35
## learn math before school            0.00 0.01 0.03 0.05 0.09 0.16 0.66
## new experiences                     0.08 0.15 0.16 0.29 0.16 0.08 0.08
## nonsense games                      0.01 0.02 0.03 0.08 0.21 0.27 0.38
## not spoiled with too much attention 0.05 0.15 0.13 0.18 0.15 0.12 0.22
## parents choose toys                 0.03 0.08 0.10 0.18 0.18 0.21 0.22
## play freely                         0.02 0.05 0.09 0.23 0.23 0.18 0.20
## play pretend                        0.00 0.01 0.03 0.11 0.16 0.22 0.48
## play with friends                   0.04 0.03 0.03 0.07 0.15 0.25 0.43
## punish for small rules              0.05 0.05 0.08 0.23 0.29 0.20 0.10
## punish misbehavior                  0.00 0.14 0.20 0.26 0.12 0.11 0.18
## reading before school               0.01 0.02 0.02 0.03 0.08 0.14 0.69
## reading before speaking             0.02 0.02 0.03 0.04 0.04 0.13 0.72
## reasons for rules                   0.02 0.03 0.04 0.08 0.16 0.20 0.46
## respect parents teachers            0.00 0.02 0.02 0.07 0.19 0.24 0.46
## rules prevent tantrums              0.20 0.17 0.15 0.20 0.16 0.06 0.06
## safe loving environment             0.00 0.00 0.01 0.03 0.06 0.12 0.78
## simple toys                         0.00 0.07 0.10 0.26 0.20 0.17 0.20
## spontaneous play                    0.00 0.02 0.06 0.21 0.16 0.30 0.25
## strict rules                        0.04 0.08 0.08 0.15 0.27 0.18 0.20
## strong bond mom                     0.00 0.00 0.01 0.06 0.08 0.22 0.63
## talk about emotions                 0.01 0.02 0.03 0.03 0.10 0.20 0.62
## talk about feelings before mature   0.01 0.03 0.03 0.06 0.12 0.23 0.52
## talk about opinions                 0.00 0.00 0.01 0.08 0.14 0.29 0.48
## too much affection does not harm    0.04 0.09 0.07 0.16 0.18 0.12 0.34
## wait when told                      0.00 0.01 0.03 0.11 0.17 0.31 0.37
## worry about misbehavior             0.01 0.04 0.08 0.16 0.24 0.21 0.27
##                                     miss
## can learn good and bad                 0
## children should be grateful            0
## control behavior                       0
## control emotions if comforted          0
## dont impose structure                  0
## dont interrupt                         0
## examples are good                      0
## follow-in good                         0
## give children comfort                  0
## holding and cradling                   0
## kids should not decide                 0
## learn before talking                   0
## learn by playing                       0
## learn contingencies                    0
## learn from other children              0
## learn from repetetive behaviors        0
## learn math before school               0
## new experiences                        0
## nonsense games                         0
## not spoiled with too much attention    0
## parents choose toys                    0
## play freely                            0
## play pretend                           0
## play with friends                      0
## punish for small rules                 0
## punish misbehavior                     0
## reading before school                  0
## reading before speaking                0
## reasons for rules                      0
## respect parents teachers               0
## rules prevent tantrums                 0
## safe loving environment                0
## simple toys                            0
## spontaneous play                       0
## strict rules                           0
## strong bond mom                        0
## talk about emotions                    0
## talk about feelings before mature      0
## talk about opinions                    0
## too much affection does not harm       0
## wait when told                         0
## worry about misbehavior                0

3.2 Rules and Respect Subscale

Raw alpha is .74 here.

wide.rules_respect <- d %>% 
  filter(category == "rules_respect") %>%
  select(workerid, short_sent, rating) %>% 
  spread(short_sent, rating)
alpha.rr <- as.matrix(select(wide.rules_respect, -workerid))
alpha(x = alpha.rr)
## 
## Reliability analysis   
## Call: alpha(x = alpha.rr)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N   ase mean   sd
##       0.74      0.76    0.78       0.2 3.1 0.032    4 0.76
## 
##  lower alpha upper     95% confidence boundaries
## 0.67 0.74 0.8 
## 
##  Reliability if an item is dropped:
##                             raw_alpha std.alpha G6(smc) average_r S/N
## children should be grateful      0.71      0.73    0.75      0.20 2.7
## control behavior                 0.71      0.73    0.76      0.20 2.8
## dont impose structure            0.71      0.73    0.75      0.20 2.8
## dont interrupt                   0.71      0.73    0.75      0.19 2.6
## kids should not decide           0.72      0.74    0.76      0.21 2.8
## punish for small rules           0.71      0.73    0.76      0.20 2.8
## punish misbehavior               0.75      0.77    0.79      0.23 3.3
## respect parents teachers         0.71      0.72    0.75      0.19 2.6
## rules prevent tantrums           0.76      0.77    0.79      0.24 3.4
## strict rules                     0.72      0.74    0.77      0.21 2.8
## wait when told                   0.71      0.72    0.75      0.19 2.6
## worry about misbehavior          0.71      0.73    0.76      0.20 2.7
##                             alpha se
## children should be grateful    0.035
## control behavior               0.034
## dont impose structure          0.035
## dont interrupt                 0.035
## kids should not decide         0.034
## punish for small rules         0.035
## punish misbehavior             0.031
## respect parents teachers       0.035
## rules prevent tantrums         0.030
## strict rules                   0.034
## wait when told                 0.035
## worry about misbehavior        0.035
## 
##  Item statistics 
##                               n raw.r std.r r.cor r.drop mean  sd
## children should be grateful 250  0.54  0.57  0.54  0.418  4.5 1.5
## control behavior            250  0.53  0.55  0.50  0.414  4.4 1.4
## dont impose structure       250  0.57  0.55  0.51  0.430  3.9 1.7
## dont interrupt              250  0.60  0.62  0.59  0.484  4.2 1.4
## kids should not decide      250  0.53  0.51  0.46  0.391  3.9 1.6
## punish for small rules      250  0.55  0.55  0.49  0.424  3.7 1.5
## punish misbehavior          250  0.29  0.28  0.15  0.116  3.4 1.7
## respect parents teachers    250  0.59  0.63  0.61  0.500  5.0 1.2
## rules prevent tantrums      250  0.28  0.24  0.10  0.086  2.4 1.8
## strict rules                250  0.53  0.51  0.43  0.377  3.9 1.7
## wait when told              250  0.60  0.64  0.61  0.512  4.8 1.2
## worry about misbehavior     250  0.60  0.59  0.54  0.474  4.3 1.5
## 
## Non missing response frequency for each item
##                                0    1    2    3    4    5    6 miss
## children should be grateful 0.00 0.03 0.06 0.20 0.16 0.18 0.37    0
## control behavior            0.00 0.03 0.05 0.20 0.20 0.24 0.27    0
## dont impose structure       0.03 0.07 0.10 0.17 0.23 0.18 0.22    0
## dont interrupt              0.00 0.04 0.06 0.24 0.21 0.21 0.24    0
## kids should not decide      0.03 0.07 0.07 0.21 0.24 0.21 0.16    0
## punish for small rules      0.05 0.05 0.08 0.23 0.29 0.20 0.10    0
## punish misbehavior          0.00 0.14 0.20 0.26 0.12 0.11 0.18    0
## respect parents teachers    0.00 0.02 0.02 0.07 0.19 0.24 0.46    0
## rules prevent tantrums      0.20 0.17 0.15 0.20 0.16 0.06 0.06    0
## strict rules                0.04 0.08 0.08 0.15 0.27 0.18 0.20    0
## wait when told              0.00 0.01 0.03 0.11 0.17 0.31 0.37    0
## worry about misbehavior     0.01 0.04 0.08 0.16 0.24 0.21 0.27    0

3.3 Affection and Attachment Subscale

Raw alpha is .81, which is up from .57 previously!

wide.affection <- d %>% 
  filter(category == "affection") %>%
  select(workerid, short_sent, rating) %>% 
  spread(short_sent, rating)
alpha.af <- as.matrix(select(wide.affection, -workerid))
alpha(x = alpha.af)
## 
## Reliability analysis   
## Call: alpha(x = alpha.af)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N   ase mean   sd
##       0.81      0.83    0.85      0.34   5 0.027  4.7 0.82
## 
##  lower alpha upper     95% confidence boundaries
## 0.75 0.81 0.86 
## 
##  Reliability if an item is dropped:
##                                     raw_alpha std.alpha G6(smc) average_r
## control emotions if comforted            0.82      0.84    0.85      0.37
## give children comfort                    0.79      0.82    0.83      0.33
## holding and cradling                     0.78      0.81    0.82      0.32
## not spoiled with too much attention      0.79      0.83    0.83      0.34
## safe loving environment                  0.79      0.81    0.83      0.32
## strong bond mom                          0.79      0.81    0.83      0.33
## talk about emotions                      0.79      0.82    0.83      0.33
## talk about feelings before mature        0.79      0.82    0.83      0.34
## talk about opinions                      0.79      0.82    0.84      0.34
## too much affection does not harm         0.77      0.81    0.82      0.33
##                                     S/N alpha se
## control emotions if comforted       5.4    0.028
## give children comfort               4.5    0.030
## holding and cradling                4.2    0.031
## not spoiled with too much attention 4.7    0.030
## safe loving environment             4.3    0.030
## strong bond mom                     4.3    0.030
## talk about emotions                 4.4    0.030
## talk about feelings before mature   4.6    0.030
## talk about opinions                 4.6    0.030
## too much affection does not harm    4.4    0.032
## 
##  Item statistics 
##                                       n raw.r std.r r.cor r.drop mean   sd
## control emotions if comforted       250  0.51  0.42  0.32   0.32  3.1 1.73
## give children comfort               250  0.61  0.64  0.59   0.51  5.1 1.06
## holding and cradling                250  0.70  0.74  0.71   0.61  5.2 1.14
## not spoiled with too much attention 250  0.67  0.58  0.53   0.51  3.5 1.89
## safe loving environment             250  0.63  0.70  0.67   0.56  5.6 0.78
## strong bond mom                     250  0.62  0.69  0.65   0.55  5.4 0.94
## talk about emotions                 250  0.61  0.66  0.62   0.50  5.3 1.22
## talk about feelings before mature   250  0.60  0.63  0.57   0.48  5.0 1.35
## talk about opinions                 250  0.56  0.61  0.55   0.46  5.1 1.00
## too much affection does not harm    250  0.75  0.68  0.65   0.62  4.0 1.86
## 
## Non missing response frequency for each item
##                                        0    1    2    3    4    5    6
## control emotions if comforted       0.08 0.13 0.15 0.24 0.18 0.11 0.11
## give children comfort               0.00 0.01 0.02 0.06 0.13 0.30 0.48
## holding and cradling                0.00 0.01 0.02 0.07 0.12 0.22 0.56
## not spoiled with too much attention 0.05 0.15 0.13 0.18 0.15 0.12 0.22
## safe loving environment             0.00 0.00 0.01 0.03 0.06 0.12 0.78
## strong bond mom                     0.00 0.00 0.01 0.06 0.08 0.22 0.63
## talk about emotions                 0.01 0.02 0.03 0.03 0.10 0.20 0.62
## talk about feelings before mature   0.01 0.03 0.03 0.06 0.12 0.23 0.52
## talk about opinions                 0.00 0.00 0.01 0.08 0.14 0.29 0.48
## too much affection does not harm    0.04 0.09 0.07 0.16 0.18 0.12 0.34
##                                     miss
## control emotions if comforted          0
## give children comfort                  0
## holding and cradling                   0
## not spoiled with too much attention    0
## safe loving environment                0
## strong bond mom                        0
## talk about emotions                    0
## talk about feelings before mature      0
## talk about opinions                    0
## too much affection does not harm       0

3.4 Active Learning Subscale

Raw alpha is .86, which is much higher than previously!

wide.active_learning <- d %>% 
  filter(category == "active_learning") %>%
  select(workerid, short_sent, rating) %>% 
  spread(short_sent, rating)
alpha.al <- as.matrix(select(wide.active_learning, -workerid))
alpha(x = alpha.al)
## 
## Reliability analysis   
## Call: alpha(x = alpha.al)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N   ase mean  sd
##       0.86      0.87    0.89      0.25 6.7 0.017  4.7 0.7
## 
##  lower alpha upper     95% confidence boundaries
## 0.82 0.86 0.89 
## 
##  Reliability if an item is dropped:
##                                 raw_alpha std.alpha G6(smc) average_r S/N
## can learn good and bad               0.85      0.86    0.88      0.25 6.2
## examples are good                    0.85      0.86    0.88      0.25 6.4
## follow-in good                       0.86      0.87    0.89      0.26 6.8
## learn before talking                 0.85      0.86    0.88      0.25 6.2
## learn by playing                     0.85      0.86    0.88      0.24 6.1
## learn contingencies                  0.85      0.86    0.88      0.25 6.4
## learn from other children            0.85      0.87    0.88      0.26 6.5
## learn from repetetive behaviors      0.85      0.86    0.88      0.25 6.3
## learn math before school             0.85      0.86    0.88      0.24 6.1
## new experiences                      0.87      0.88    0.89      0.27 7.1
## nonsense games                       0.85      0.86    0.88      0.25 6.2
## parents choose toys                  0.85      0.87    0.88      0.26 6.5
## play freely                          0.85      0.87    0.88      0.25 6.4
## play pretend                         0.85      0.86    0.88      0.25 6.2
## play with friends                    0.85      0.86    0.88      0.25 6.3
## reading before school                0.85      0.86    0.88      0.25 6.2
## reading before speaking              0.85      0.86    0.88      0.25 6.3
## reasons for rules                    0.85      0.86    0.88      0.25 6.4
## simple toys                          0.86      0.87    0.89      0.27 6.9
## spontaneous play                     0.86      0.87    0.89      0.26 6.6
##                                 alpha se
## can learn good and bad             0.018
## examples are good                  0.018
## follow-in good                     0.018
## learn before talking               0.019
## learn by playing                   0.019
## learn contingencies                0.018
## learn from other children          0.018
## learn from repetetive behaviors    0.018
## learn math before school           0.019
## new experiences                    0.017
## nonsense games                     0.019
## parents choose toys                0.018
## play freely                        0.018
## play pretend                       0.019
## play with friends                  0.019
## reading before school              0.019
## reading before speaking            0.018
## reasons for rules                  0.018
## simple toys                        0.017
## spontaneous play                   0.018
## 
##  Item statistics 
##                                   n raw.r std.r r.cor r.drop mean   sd
## can learn good and bad          250  0.60  0.64  0.62   0.55  5.3 0.98
## examples are good               250  0.51  0.55  0.52   0.45  5.1 1.08
## follow-in good                  250  0.36  0.37  0.31   0.27  4.3 1.30
## learn before talking            250  0.62  0.65  0.64   0.57  5.3 1.02
## learn by playing                250  0.65  0.67  0.66   0.60  5.3 1.03
## learn contingencies             250  0.52  0.55  0.52   0.46  5.0 1.07
## learn from other children       250  0.51  0.48  0.44   0.42  4.1 1.63
## learn from repetetive behaviors 250  0.56  0.56  0.53   0.49  4.6 1.35
## learn math before school        250  0.65  0.66  0.65   0.60  5.3 1.19
## new experiences                 250  0.27  0.24  0.17   0.16  2.9 1.62
## nonsense games                  250  0.64  0.64  0.62   0.59  4.8 1.29
## parents choose toys             250  0.52  0.49  0.45   0.43  3.9 1.70
## play freely                     250  0.55  0.53  0.49   0.47  3.9 1.54
## play pretend                    250  0.64  0.65  0.63   0.59  5.0 1.23
## play with friends               250  0.60  0.57  0.54   0.51  4.7 1.61
## reading before school           250  0.62  0.63  0.62   0.56  5.3 1.26
## reading before speaking         250  0.58  0.59  0.56   0.51  5.3 1.39
## reasons for rules               250  0.58  0.56  0.53   0.50  4.8 1.54
## simple toys                     250  0.29  0.29  0.23   0.19  3.9 1.52
## spontaneous play                250  0.46  0.45  0.40   0.38  4.4 1.31
## 
## Non missing response frequency for each item
##                                    0    1    2    3    4    5    6 miss
## can learn good and bad          0.00 0.00 0.01 0.06 0.09 0.28 0.56    0
## examples are good               0.00 0.01 0.01 0.08 0.13 0.29 0.48    0
## follow-in good                  0.00 0.03 0.06 0.18 0.24 0.28 0.20    0
## learn before talking            0.00 0.01 0.01 0.04 0.12 0.20 0.62    0
## learn by playing                0.00 0.00 0.02 0.06 0.13 0.22 0.57    0
## learn contingencies             0.00 0.00 0.02 0.08 0.16 0.32 0.41    0
## learn from other children       0.04 0.04 0.07 0.17 0.24 0.18 0.27    0
## learn from repetetive behaviors 0.00 0.02 0.06 0.16 0.14 0.27 0.35    0
## learn math before school        0.00 0.01 0.03 0.05 0.09 0.16 0.66    0
## new experiences                 0.08 0.15 0.16 0.29 0.16 0.08 0.08    0
## nonsense games                  0.01 0.02 0.03 0.08 0.21 0.27 0.38    0
## parents choose toys             0.03 0.08 0.10 0.18 0.18 0.21 0.22    0
## play freely                     0.02 0.05 0.09 0.23 0.23 0.18 0.20    0
## play pretend                    0.00 0.01 0.03 0.11 0.16 0.22 0.48    0
## play with friends               0.04 0.03 0.03 0.07 0.15 0.25 0.43    0
## reading before school           0.01 0.02 0.02 0.03 0.08 0.14 0.69    0
## reading before speaking         0.02 0.02 0.03 0.04 0.04 0.13 0.72    0
## reasons for rules               0.02 0.03 0.04 0.08 0.16 0.20 0.46    0
## simple toys                     0.00 0.07 0.10 0.26 0.20 0.17 0.20    0
## spontaneous play                0.00 0.02 0.06 0.21 0.16 0.30 0.25    0

4 Factor analysis

Get eigenvalues for determining number of factors.

att.mat <- select(wide.attitudes, -workerid)

ev <- eigen(cor(x=att.mat)) # get eigenvalues

ap <- parallel(subject=nrow(att.mat), var=ncol(att.mat),
               rep=100,cent=.05)
nS <- nScree(x=ev$values, aparallel=ap$eigen$qevpea)
plotnScree(nS)

Now plot factor analysis

Because we predicted 3 factors, I am going with 3 here (confirmatory FA)

In the graph items are organized by category, from Early/Active Learning -> Affection and Attachment -> Rules and Respect.

Things are looking a bit hazy in terms of individual items mapping onto factors. In particular, most of the Early/Active Learning AND Affection and Attachment items map onto Factor 1. Factor 2 has an almost even mix of all 3 categories. Also, it seems like items related to Rules (Factor 3) are separate from those ostensibly related to Respect (Factor 2). It seems that items related to strict rules are most consistently hanging together across experiments.

n.factors <- 3

af <- factanal(x=att.mat, factors = n.factors, scores = "regression")
loadings <- data.frame(af$loadings[,1:n.factors]) %>%
  mutate(item = rownames(af$loadings)) %>%
  gather(factor, loading, starts_with("Factor"))

loadings$item <- factor(loadings$item, levels = c("respect parents teachers","punish misbehavior","dont interrupt","wait when told","control behavior", "children should be grateful", "strict rules", "punish for small rules", "worry about misbehavior", "dont impose structure","rules prevent tantrums", "kids should not decide", "strong bond mom", "safe loving environment", "holding and cradling", "talk about opinions", "give children comfort", "talk about emotions", "talk about feelings before mature", "not spoiled with too much attention", "too much affection does not harm", "control emotions if comforted", "examples are good", "can learn good and bad ", "follow-in good", "spontaneous play", "learn before talking", "learn by playing", "learn contingencies", "learn from repetetive behaviors", "play pretend", "simple toys", "reasons for rules", "learn math before school", "learn from other children", "play with friends", "new experiences", "reading before school", "nonsense games", "play freely", "parents choose toys", "reading before speaking"))

labels$item <- labels$short_sent
loadings <- join(loadings, labels, by = "item")

qplot(factor, item, fill=loading, geom="tile", data = loadings) + 
  scale_fill_continuous(low="#000000", high="#FFFFFF") + facet_grid(. ~ category)

qplot(factor, item, fill=loading > .35, geom="tile", data = loadings) + 
  scale_fill_solarized()+ facet_grid(. ~ category)

Now with the suggested 5 factors.

n.factors <- 5

af <- factanal(x=att.mat, factors = n.factors, scores = "regression")
loadings <- data.frame(af$loadings[,1:n.factors]) %>%
  mutate(item = rownames(af$loadings)) %>%
  gather(factor, loading, starts_with("Factor"))

loadings$item <- factor(loadings$item, levels = c("respect parents teachers","punish misbehavior","dont interrupt","wait when told","control behavior", "children should be grateful", "strict rules", "punish for small rules", "worry about misbehavior", "dont impose structure","rules prevent tantrums", "kids should not decide", "strong bond mom", "safe loving environment", "holding and cradling", "talk about opinions", "give children comfort", "talk about emotions", "talk about feelings before mature", "not spoiled with too much attention", "too much affection does not harm", "control emotions if comforted", "examples are good", "can learn good and bad ", "follow-in good", "spontaneous play", "learn before talking", "learn by playing", "learn contingencies", "learn from repetetive behaviors", "play pretend", "simple toys", "reasons for rules", "learn math before school", "learn from other children", "play with friends", "new experiences", "reading before school", "nonsense games", "play freely", "parents choose toys", "reading before speaking"))

loadings <- join(loadings, labels, by = "item")

qplot(factor, item, fill=loading, geom="tile", data = loadings) + 
  scale_fill_continuous(low="#000000", high="#FFFFFF")+ facet_grid(. ~ category)

qplot(factor, item, fill=loading > .35, geom="tile", data = loadings) + 
  scale_fill_solarized()+ facet_grid(. ~ category)+ facet_grid(. ~ category)

Merge back in subject id info.

a.scores <- af$scores %>%
  data.frame %>%
  mutate(workerid = as.character(wide.attitudes$workerid)) %>%
  left_join(subinfo)

And summary:

4.1 Factors by SES

a.factor.names <- c("Active Learning and Affection", "Early Learning, Affection, Respect", "Strict Rules")

ms <- a.scores %>% 
  gather(factor, score, starts_with("Factor")) %>%
  filter(ses != "") %>%
  mutate(high.ses = ses > 5, 
         factor.num = as.numeric(str_replace(factor,"Factor","")),
         factor.name = a.factor.names[factor.num]) %>%
  group_by(high.ses, factor.name) %>%
  multi_boot_standard(col = "score") 

qplot(factor.name, mean, fill=high.ses, 
      geom = "bar", stat = "identity", position = "dodge", 
      data=ms) + 
  geom_linerange(aes(ymin = ci_lower, ymax = ci_upper), 
             position = position_dodge(width = .9))

4.2 Factors by Gender

ms <- a.scores %>% 
  gather(factor, score, starts_with("Factor")) %>%
  filter(gender != "") %>%
  mutate(male.gender = gender == "Male",
         factor.num = as.numeric(str_replace(factor,"Factor","")),
         factor.name = a.factor.names[factor.num]) %>%
  group_by(male.gender, factor.name) %>%
  multi_boot_standard(col = "score") 

qplot(factor.name, mean, fill=male.gender, 
      geom = "bar", stat = "identity", position = "dodge", 
      data=ms) + 
  geom_linerange(aes(ymin = ci_lower, ymax = ci_upper), 
             position = position_dodge(width = .9))

4.3 Factors by Education

ms <- a.scores %>% 
  gather(factor, score, starts_with("Factor")) %>%
  filter(education != "") %>%
  mutate(high.education = (education == "4year" |education == "someGrad" | education == "Grad"),
         factor.num = as.numeric(str_replace(factor,"Factor","")),
         factor.name = a.factor.names[factor.num]) %>%
  group_by(high.education, factor.name) %>%
  multi_boot_standard(col = "score") 

qplot(factor.name, mean, fill=high.education, 
      geom = "bar", stat = "identity", position = "dodge", 
      data=ms) + 
  geom_linerange(aes(ymin = ci_lower, ymax = ci_upper), 
             position = position_dodge(width = .9))

4.4 Factors by Age

ms <- a.scores %>% 
  gather(factor, score, starts_with("Factor")) %>%
  filter(age != "") %>%
  mutate(young.age = (age == "0-19" |age == "20-29"),
         factor.num = as.numeric(str_replace(factor,"Factor","")),
         factor.name = a.factor.names[factor.num]) %>%
  group_by(young.age, factor.name) %>%
  multi_boot_standard(col = "score") 

qplot(factor.name, mean, fill=young.age, 
      geom = "bar", stat = "identity", position = "dodge", 
      data=ms) + 
  geom_linerange(aes(ymin = ci_lower, ymax = ci_upper), 
             position = position_dodge(width = .9))

4.5 Factors by Children

ms <- a.scores %>% 
  gather(factor, score, starts_with("Factor")) %>%
  filter(children != "") %>%
  mutate(n.children = children,
         factor.num = as.numeric(str_replace(factor,"Factor","")),
         factor.name = a.factor.names[factor.num]) %>%
  group_by(n.children, factor.name) %>%
  multi_boot_standard(col = "score") 

qplot(factor.name, mean, fill=n.children, 
      geom = "bar", stat = "identity", position = "dodge", 
      data=ms) + 
  geom_linerange(aes(ymin = ci_lower, ymax = ci_upper), 
             position = position_dodge(width = .9))

ms <- a.scores %>% 
  gather(factor, score, starts_with("Factor")) %>%
  filter(children != "") %>%
  mutate(yes.children = (children == "1" | children == "2" | children == "3"| children == "4"| children == "5"),
         factor.num = as.numeric(str_replace(factor,"Factor","")),
         factor.name = a.factor.names[factor.num]) %>%
  group_by(yes.children, factor.name) %>%
  multi_boot_standard(col = "score") 

qplot(factor.name, mean, fill=yes.children, 
      geom = "bar", stat = "identity", position = "dodge", 
      data=ms) + 
  geom_linerange(aes(ymin = ci_lower, ymax = ci_upper), 
             position = position_dodge(width = .9))

4.6 Factors by Ethnicity

ms <- a.scores %>% 
  gather(factor, score, starts_with("Factor")) %>%
  filter(ethnicity != "") %>%
  mutate(hispanic = ethnicity== "Hispanic",
         factor.num = as.numeric(str_replace(factor,"Factor","")),
         factor.name = a.factor.names[factor.num]) %>%
  group_by(hispanic, factor.name) %>%
  multi_boot_standard(col = "score") 

qplot(factor.name, mean, fill=hispanic, 
      geom = "bar", stat = "identity", position = "dodge", 
      data=ms) + 
  geom_linerange(aes(ymin = ci_lower, ymax = ci_upper), 
             position = position_dodge(width = .9))

5 Conclusions

Our predicted factor structure did not hold up well. The items that consistently hang together and form their own factor are those related to strict rules.

Might need to rethink the organization of attitudes. Something separating out parents who see their kids as “projects” versus believing they will naturally thrive might make sense. The grouping of early learning and affection items into one factor might reflect this latent theory.