socsupport | R Documentation |
Data from a survey on social and other kinds of support.
socsupport
This data frame contains the following columns:
a factor with levels
female
, male
age, in years, with levels
18-20
, 21-24
, 25-30
,
31-40
,40+
a factor with levels australia
,
other
a factor with levels married
,
other
, single
a factor with levels alone
,
friends
, other
, parents
,
partner
, residences
a factor with levels
employed fulltime
, employed part-time
,
govt assistance
, other
, parental support
a factor with levels first year
,
other
a factor with levels
full-time
, part-time
, <NA>
summary of 5 questions on emotional support availability
summary of 5 questions on emotional support satisfaction
summary of 4 questions on availability of tangible support
summary of 4 questions on satisfaction with tangible support
summary of 3 questions on availability of affectionate support sources
summary of 3 questions on satisfaction with affectionate support sources
summary of 3 questions on availability of positive social interaction
summary of 3 questions on satisfaction with positive social interaction
summary of 4 questions on extent of emotional support sources
summary of 4 questions on extent of practical support sources
summary of 4 questions on extent of social support sources (formerly, socsupport)
Score on the Beck depression index (summary of 21 questions)
Melissa Manning, Psychology, Australian National University
attach(socsupport)
not.na <- apply(socsupport[,9:19], 1, function(x)!any(is.na(x)))
ss.pr1 <- princomp(as.matrix(socsupport[not.na, 9:19]), cor=TRUE)
pairs(ss.pr1$scores[,1:3])
sort(-ss.pr1$scores[,1]) # Minus the largest value appears first
pause()
not.na[36] <- FALSE
ss.pr <- princomp(as.matrix(socsupport[not.na, 9:19]), cor=TRUE)
summary(ss.pr) # Examine the contribution of the components
pause()
# We now regress BDI on the first six principal components:
ss.lm <- lm(BDI[not.na] ~ ss.pr$scores[, 1:6], data=socsupport)
summary(ss.lm)$coef
pause()
ss.pr$loadings[,1]
plot(BDI[not.na] ~ ss.pr$scores[ ,1], col=as.numeric(gender),
pch=as.numeric(gender), xlab ="1st principal component", ylab="BDI")
topleft <- par()$usr[c(1,4)]
legend(topleft[1], topleft[2], col=1:2, pch=1:2, legend=levels(gender))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.