fSRM {fSRM} | R Documentation |
Run a Social Relations Model with roles ("Family SRM")
Description
Run a Social Relations Model with roles ("Family SRM")
Usage
fSRM(
formula = NULL,
data,
drop = "default",
add = "",
means = FALSE,
pairwise = FALSE,
diff = FALSE,
IGSIM = list(),
add.variable = c(),
syntax = "",
group = NULL,
noNegVar = FALSE,
rolesEqual = FALSE,
missing = NA,
...
)
Arguments
formula |
A formula that defines the variable names. Should be in one of following formats: (1) Single manifest dependent variable: DV ~ actor.id * partner.id | group.id, (2) Multiple indicators for dependent variable: DV1/DV2/DV3 ~ actor.id * parter.id | group.id. |
data |
A data frame with all variables defined by |
drop |
In three-member families at least one component has to be dropped. |
add |
Additional lavaan syntax pasted at the end of the generated model. Can contain, for example, user specified error correlations. |
means |
Should the structured means of the SRM factors be calculated? |
pairwise |
Compute pairwise comparison of actor and partner means between all roles? Only works when |
diff |
Compare groups with the delta method? You need to specify a group identifier in parameter |
IGSIM |
Define intragenerational similarity correlations. Must be a list where the levels of actor.id and partner.id are combined, e.g.: |
add.variable |
Not yet fully implemented: Add external variables to the model syntax. |
syntax |
In that variable the user can directly provide a lavaan model syntax. Then no automatical model syntax is generated. |
group |
Variable name indicating group membership. This can be used two compare two classes of families (e.g., clinical families vs. control families). If this variable is provided, it must contain exactly two levels. |
noNegVar |
Should variance estimates be constrained to be positive? |
rolesEqual |
Maximal constraints: Do roles matter at all? If this parameter is set to TRUE, it is a model with no mean difference, the actor variances equal, partner variances equal, relationship variances equal, and the respective reciprocities equal (Thanks to a suggestion of David Kenny). Model comparisons via |
missing |
Handling of missing values. By default ( |
... |
Additional arguments passed to the |
Details
A model can be rerun with additional syntax using the add
function:
s1 <- fSRM(dep1/dep2 ~ actor*partner | fam, dat2)
s2 <- add(s1, "Ac ~~ Pm")
A model can be run with new parameters using the update function:
s1 <- fSRM(dep1/dep2 ~ actor*partner | fam, dat2)
s2 <- update(s1, diff=TRUE)
The fSRM
function relies on the lavaan
package for computation: A syntax for the SRM with roles is generated and then passed to the lavaan
function. Hence, many options of the lavaan
function can be used out-of-the-box (additional parameters are passed to the lavaan
function through the ...
operator). For example, one can deal with missing values. The default behavior is to exclude families with missing values (listwise deletion). Set fSRM(..., missing="fiml")
for ML / FIML estimation. Or, you can request bootstrapped standard errors with fSRM(..., se="boot")
.
You can test for a very restricted model by constraining the roles to be equal ("Do roles matter at all?"). Therefore, compare a model with free roles (m1 <- fSRM(..., means=TRUE, rolesEqual = FALSE)
) with a model with equal roles (m2 <- fSRM(..., means=TRUE, rolesEqual=TRUE)
) using anova(m1$fit, m2$fit)
(Thanks to David Kenny for the suggestion).
For plotting relative variances and mean structure, see plot.fSRM
.
References
Kenny, D. A., & West, T. V. (2010). Similarity and Agreement in Self-and Other Perception: A Meta-Analysis. Personality and Social Psychology Review, 14(2), 196-213. doi:10.1177/1088868309353414
See Also
Examples
# Example from Dyadic Data Analysis
data(two.indicators)
# 4 persons, 1 indicator
f4.1 <- fSRM(dep1 ~ actor.id*partner.id | family.id, two.indicators)
f4.1 # by default, one-sided p-values and CIs are printed for variances
print(f4.1, var.onesided=FALSE) # Show two-sided p-values and CIs for variances
plot(f4.1) # plot relative variances
plot(f4.1, bw=TRUE)
## Not run:
# 4 persons, 2 indicators
f4.2 <- fSRM(dep1/dep2 ~ actor.id*partner.id | family.id, two.indicators)
f4.2
plot(f4.2, bw=TRUE)
plot(f4.2, bw=TRUE, onlyStable=TRUE)
# 4 persons, 1 indicator, mean structure
f4.1.m <- fSRM(dep1 ~ actor.id*partner.id | family.id, two.indicators, means=TRUE)
f4.1.m
plot(f4.1.m, means=TRUE) # plot mean structure
# 4 persons, 2 indicators, mean structure
f4.2.m <- fSRM(dep1/dep2 ~ actor.id*partner.id | family.id, two.indicators, means=TRUE)
f4.2.m
# ... add intragenerational similarity (now results are identical to Cook, 2000)
f4.ig <- fSRM(dep1/dep2 ~ actor.id*partner.id | family.id, two.indicators,
IGSIM=list(c("m", "f"), c("c", "y")))
f4.ig
## ======================================================================
## Wald-test for equality of means
## ======================================================================
f4.1.m <- fSRM(dep1 ~ actor.id*partner.id | family.id, two.indicators, means=TRUE)
f4.1.m
equalMeans(f4.1.m)
# construct a 3-person data set
two.indicators3 <-
two.indicators[two.indicators$actor.id != "y" & two.indicators$partner.id != "y", ]
f3.2.m <- fSRM(dep1/dep2 ~ actor.id*partner.id | family.id, two.indicators3, means=TRUE)
f3.2.m
equalMeans(f3.2.m)
# ---------------------------------------------------------------------
# Run analyses based on Eichelsheim, V. I., Buist, K. L., Dekovic, M.,
Cook, W. L., Manders, W., Branje, S. J. T., Frijns, T., et al. (2011).
Negativity in problematic and nonproblematic families:
A multigroup social relations model analysis with structured means.
Journal of Family Psychology, 25, 152-156. doi:10.1037/a0022450
# The data set is a simulated data set which has
# comparable properties as the original data set
data(two.groups)
str(two.groups)
E1 <- fSRM(neg ~ actor.id*partner.id | family.id, data=two.groups)
E1
# make group comparison:
# group = 1: non-problematic families, group = 2: problematic families
# The data set must contain exactly two groups, otherwise an error is printed
E2 <- fSRM(neg ~ actor.id*partner.id | family.id, data=two.groups, group="group")
E2
# Compare means and differences between groups. Beware: This model takes *really* long ...
E3 <- fSRM(neg ~ actor.id*partner.id | family.id,
data=two.groups, group="group", means=TRUE, diff=TRUE)
E3
## End(Not run)