Title: | Structural Equation Modeling for the Social Relations Model |
---|---|
Description: | Provides functionality for structural equation modeling for the social relations model (Kenny & La Voie, 1984; <doi:10.1016/S0065-2601(08)60144-6>; Warner, Kenny, & Soto, 1979, <doi:10.1037/0022-3514.37.10.1742>). Maximum likelihood estimation (Gill & Swartz, 2001, <doi:10.2307/3316080>; Nestler, 2018, <doi:10.3102/1076998617741106>) and least squares estimation is supported (Bond & Malloy, 2018, <doi:10.1016/B978-0-12-811967-9.00014-X>). |
Authors: | Steffen Nestler [aut], Alexander Robitzsch [aut, cre], Oliver Luedtke [aut] |
Maintainer: | Alexander Robitzsch <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.5-1 |
Built: | 2024-08-26 04:17:58 UTC |
Source: | https://github.com/alexanderrobitzsch/srm |
Provides functionality for structural equation modeling for the social relations model (Kenny & La Voie, 1984; <doi:10.1016/S0065-2601(08)60144-6>; Warner, Kenny, & Soto, 1979, <doi:10.1037/0022-3514.37.10.1742>). Maximum likelihood estimation (Gill & Swartz, 2001, <doi:10.2307/3316080>; Nestler, 2018, <doi:10.3102/1076998617741106>) and least squares estimation is supported (Bond & Malloy, 2018, <doi:10.1016/B978-0-12-811967-9.00014-X>).
Steffen Nestler [aut], Alexander Robitzsch [aut, cre], Oliver Luedtke [aut]
Maintainer: Alexander Robitzsch <[email protected]>
Bond, C. F., & Malloy, T. E. (2018a). Social relations analysis of dyadic data structure: The general case. In T. E. Malloy. Social relations modeling of behavior in dyads and groups (Ch. 14). Academic Press. doi:10.1016/B978-0-12-811967-9.00014-X
Gill, P. S., & Swartz, T. B. (2001). Statistical analyses for round robin interaction data. Canadian Journal of Statistics, 29(2), 321-331. doi:10.2307/3316080
Kenny, D. A., & La Voie, L. J. (1984). The social relations model. In L. Berkowitz (Ed.), Advances in experimental social psychology (Vol. 18, pp. 142-182). Orlando, FL: Academic. doi:10.1016/S0065-2601(08)60144-6
Nestler, S. (2018). Likelihood estimation of the multivariate social relations model. Journal of Educational and Behavioral Statistics, 43(4), 387-406. doi:10.3102/1076998617741106
Warner, R. M., Kenny, D. A., & Soto, M. (1979). A new round robin analysis of variance for social interaction data. Journal of Personality and Social Psychology, 37(10), 1742-1757. doi:10.1037/0022-3514.37.10.1742
See also the R packages amen and TripleR for estimating the social relations model.
Dataset used in Back, Schmukle and Egloff (2011).
data(data.back)
data(data.back)
The dataset data.back
is a round-robin desiogn with 54 units and
has the following structure
'data.frame': 2862 obs. of 8 variables:
$ Group : num 1 1 1 1 1 1 1 1 1 1 ...
$ Actor : int 1 1 1 1 1 1 1 1 1 1 ...
$ Partner: int 2 3 4 5 6 7 8 9 10 11 ...
$ Dyad : int 1 2 3 4 5 6 7 8 9 10 ...
$ y : int 3 3 2 2 4 3 3 2 3 3 ...
$ sex : int 1 1 1 1 1 1 1 1 1 1 ...
$ age : int 22 22 22 22 22 22 22 22 22 22 ...
$ n : num -1.17 -1.17 -1.17 -1.17 -1.17 -1.17 -1.17 -1.17 -1.17 -1.17 ...
Back, M. D., Schmukle, S. C., & Egloff, B. (2011). A closer look at first sight: Social relations lens model analysis of personality and interpersonal attraction at zero acquaintance. European Journal of Personality, 25(3), 225-238. doi:10.1002/per.790
This is the illustration dataset of Bond and Malloy (2018) for a bivariate social relations model. The round robin design contains 16 persons and some missing values for one person.
data(data.bm1) data(data.bm2)
data(data.bm1) data(data.bm2)
The dataset data.bm1
contains all ratings in a wide
format. The two outcomes are arranged one below the other.
'data.frame': 32 obs. of 16 variables:
$ a: int NA 12 13 14 15 15 14 14 13 13 ...
$ b: int 10 NA 10 18 7 15 14 8 12 12 ...
$ c: int 13 12 NA 14 13 14 13 13 11 12 ...
[...]
$ p: int 11 13 14 14 9 8 17 13 11 12 ...
The dataset data.bm2
is a subdataset of data.bm1
which contains observations 9 to 16.
http://thomasemalloy.org/arbsrm-the-general-social-relations-model/
Bond, C. F., & Malloy, T. E. (2018a). Social relations analysis of dyadic data structure: The general case. In T. E. Malloy. Social relations modeling of behavior in dyads and groups (Ch. 14). Academic Press. doi:10.1016/B978-0-12-811967-9.00014-X
Some simulated example datasets for the srm package.
data(data.srm01)
data(data.srm01)
The dataset data.srm01
contains three variables, 10 round robin
groups with 10 members each.
'data.frame': 900 obs. of 7 variables:
$ Group : num 1 1 1 1 1 1 1 1 1 1 ...
$ dyad : num 1 2 3 4 5 6 7 8 9 10 ...
$ Actor : num 1 1 1 1 1 1 1 1 1 2 ...
$ Partner: num 2 3 4 5 6 7 8 9 10 3 ...
$ Wert1 : num -0.15 -0.95 0.82 1.15 -1.79 1.17 1.79 -0.57 -0.46 1.19 ...
$ Wert2 : num -0.77 0.17 0.42 0.16 -0.44 0.89 1.67 -1.9 -0.74 2.67 ...
$ Wert3 : num -0.49 0.08 -0.12 1.16 -2.78 -0.74 2.66 -1.28 -0.45 1.93 ...
Data from Kenny et al. (1994)
data(HallmarkKenny)
data(HallmarkKenny)
A data frame with 802 measurements of 30 round-robin groups on the following 7
round-robin variables (taken on unnumbered 7-point rating scales with higher numbers
indicating a higher value of the trait):
calm
: rating of dimension calm-anxious sociable
rating of dimension sociable-withdrawn liking
rating of dimension like-do not like careful
rating of dimension careful-careless relaxed
rating of dimension relaxed-tense talkative
rating of dimension talkative-quiet responsible
rating of dimension responsible-undependable
The data frame also contains participants gender (actor.sex
; 1
= F,
2
= M) and their age in years (actor.age
).
Note that the data was assessed in two conditions: odd round robin group numbers indicate
groups in which participants rated all traits for a person at a time whereas even numbers
refer to groups in which participants rated all the people for each trait.
http://davidakenny.net/srm/srmdata.htm
Kenny, D. A., Albright, L., Malloy, T. E., & Kashy, D. A. (1994). Consensus in interpersonal perception: Acquaintance and the big five. Psychological Bulletin, 116(2), 245-258. doi:10.1037/0033-2909.116.2.245
Data from Albright et al. (1988) Study 2
data(Kenzer)
data(Kenzer)
A data frame with 124 measurements from 7 round-robin groups on the following 5 round-robin
variables (taken on unnumbered 7-point rating scales with higher numbers indicating a
higher value of the trait):
sociable
: rating of dimension sociable irritable
: rating of dimension good-natured responsible
: rating of dimension responsible anxious
: rating of dimension calm intellectual
: rating of dimension intellectual
The data frame also contains the gender (actor.sex
; 1
= F,
2
= M) of the participants and their self-ratings on the five assessed traits
(actor.sociable
and so on).
http://davidakenny.net/srm/srmdata.htm
Albright, L., Kenny, D. A., & Malloy, T. E. (1988). Consensus in personality judgments at zero acquaintance. Journal of Personality and Social Psychology, 55(3), 387-395. doi:10.1037/0022-3514.55.3.387
Data from Albright et al. (1988) Study 1
data(Malzer)
data(Malzer)
A data frame with 216 measurements from 12 round-robin groups on the following 5 round-robin
variables (assessed on numbered 7-point rating scales with higher numbers indicating a
higher value of the trait with the exception for good and calm):
sociable
: rating of dimension sociable irritable
: rating of dimension good-natured responsible
: rating of dimension responsible anxious
: rating of dimension calm intellectual
: rating of dimension intellectual
The data frame also contains the gender (actor.sex
; 1
= F,
2
= M) of the participants and their self-ratings on the five assessed traits
(actor.sociable
and so on).
http://davidakenny.net/srm/srmdata.htm
Albright, L., Kenny, D. A., & Malloy, T. E. (1988). Consensus in personality judgments at zero acquaintance. Journal of Personality and Social Psychology, 55(3), 387-395. doi:10.1037/0022-3514.55.3.387
Provides an estimation routine for a multiple group structural equation model for the social relations model (SRM; Kenny & La Voie, 1984; Warner, Kenny, & Soto, 1979). The model is estimated by maximum likelihood (Gill & Swartz, 2001; Nestler, 2018).
srm(model.syntax = NULL, data = NULL, group.var = NULL, rrgroup_name = NULL, person_names = c("Actor", "Partner"), fixed.groups = FALSE, var_positive = -1, optimizer = "srm", maxiter = 300, conv_dev = 1e-08, conv_par = 1e-06, do_line_search = TRUE, line_search_iter_max = 6, verbose = TRUE, use_rcpp = TRUE, shortcut = TRUE, use_woodbury = TRUE) ## S3 method for class 'srm' coef(object, ...) ## S3 method for class 'srm' vcov(object, ...) ## S3 method for class 'srm' summary(object, digits=3, file=NULL, layout=1, ...) ## S3 method for class 'srm' logLik(object, ...)
srm(model.syntax = NULL, data = NULL, group.var = NULL, rrgroup_name = NULL, person_names = c("Actor", "Partner"), fixed.groups = FALSE, var_positive = -1, optimizer = "srm", maxiter = 300, conv_dev = 1e-08, conv_par = 1e-06, do_line_search = TRUE, line_search_iter_max = 6, verbose = TRUE, use_rcpp = TRUE, shortcut = TRUE, use_woodbury = TRUE) ## S3 method for class 'srm' coef(object, ...) ## S3 method for class 'srm' vcov(object, ...) ## S3 method for class 'srm' summary(object, digits=3, file=NULL, layout=1, ...) ## S3 method for class 'srm' logLik(object, ...)
model.syntax |
Syntax similar to lavaan language, see Examples. |
data |
Data frame containing round robin identifier variables and variables in the round robin design |
group.var |
Name of grouping variable |
rrgroup_name |
Name of variable indicating round robin group |
person_names |
Names for identifier variables for actors and partners |
fixed.groups |
Logical indicating whether groups should be handled with fixed effects |
var_positive |
Nonnegative value if variances are constrained to be positive |
optimizer |
Optimizer to be used: |
maxiter |
Maximum number of iterations |
conv_dev |
Convergence criterion for change relative deviance |
conv_par |
Convergence criterion for change in parameters |
do_line_search |
Logical indicating whether line search should be performed |
line_search_iter_max |
Number of iterations during line search algorithm |
verbose |
Logical indicating whether convergence progress should be displayed |
use_rcpp |
Logical indicating whether Rcpp package should be used |
shortcut |
Logical indicating whether shortcuts for round robin groups with same structure should be used |
use_woodbury |
Logical indicating whether matrix inversion should be simplified by Woodbury identity |
object |
Object of class |
file |
Optional file name for summary output |
digits |
Number of digits after decimal in summary output |
layout |
Different layouts ( |
... |
Further arguments to be passed |
List with following entries (selection)
parm.table |
Parameter table with estimated values |
coef |
Vector of parameter estimates |
vcov |
Covariance matrix of parameter estimates |
parm_list |
List of model matrices |
sigma |
Model implied covariance matrices |
... |
Further values |
Gill, P. S., & Swartz, T. B. (2001). Statistical analyses for round robin interaction data. Canadian Journal of Statistics, 29(2), 321-331. doi:10.2307/3316080
Kenny, D. A., & La Voie, L. J. (1984). The social relations model. In L. Berkowitz (Ed.), Advances in experimental social psychology (Vol. 18, pp. 142-182). Orlando, FL: Academic. doi:10.1016/S0065-2601(08)60144-6
Nestler, S. (2018). Likelihood estimation of the multivariate social relations model. Journal of Educational and Behavioral Statistics, 43(4), 387-406. doi:10.3102/1076998617741106
Warner, R. M., Kenny, D. A., & Soto, M. (1979). A new round robin analysis of variance for social interaction data. Journal of Personality and Social Psychology, 37(10), 1742-1757. doi:10.1037/0022-3514.37.10.1742
See also TripleR and amen packages for alternative estimation routines for the SRM.
############################################################################# # EXAMPLE 1: Univariate SRM ############################################################################# data(data.srm01, package="srm") dat <- data.srm01 #-- define model mf <- ' %Person F1@A =~ 1*Wert1@A F1@P =~ 1*Wert1@P Wert1@A ~~ 0*Wert1@A + 0*Wert1@P Wert1@P ~~ 0*Wert1@P %Dyad F1@AP =~ 1*Wert1@AP F1@PA =~ 1*Wert1@PA Wert1@AP ~~ 0*Wert1@AP + 0*Wert1@PA Wert1@PA ~~ 0*Wert1@PA ' #-- estimate model mod1 <- srm::srm(mf, data = dat, rrgroup_name="Group", conv_par=1e-4, maxiter=20) summary(mod1) round(coef(mod1),3) ############################################################################# # EXAMPLE 2: Bivariate SRM ############################################################################# data(data.srm01, package="srm") dat <- data.srm01 #-- define model mf <- ' %Person F1@A =~ 1*Wert1@A F1@P =~ 1*Wert1@P F2@A =~ 1*Wert2@A F2@P =~ 1*Wert2@P Wert1@A ~~ 0*Wert1@A + 0*Wert1@P Wert1@P ~~ 0*Wert1@P Wert2@A ~~ 0*Wert2@A + 0*Wert2@P Wert2@P ~~ 0*Wert2@P %Dyad F1@AP =~ 1*Wert1@AP F1@PA =~ 1*Wert1@PA F2@AP =~ 1*Wert2@AP F2@PA =~ 1*Wert2@PA Wert1@AP ~~ 0*Wert1@AP + 0*Wert1@PA Wert1@PA ~~ 0*Wert1@PA Wert2@AP ~~ 0*Wert2@AP + 0*Wert2@PA Wert2@PA ~~ 0*Wert2@PA ' #-- estimate model mod1 <- srm::srm(mf, data = dat, rrgroup_name="Group", conv_par=1e-4, maxiter=20) summary(mod1) ############################################################################# # EXAMPLE 3: One-factor model ############################################################################# data(data.srm01, package="srm") dat <- data.srm01 #-- define model mf <- ' # definition of factor for persons and dyad %Person f1@A=~Wert1@A+Wert2@A+Wert3@A f1@P=~Wert1@P+Wert2@P+Wert3@P %Dyad f1@AP=~Wert1@AP+Wert2@AP+Wert3@AP # define some constraints Wert1@AP ~~ 0*Wert1@PA Wert3@AP ~~ 0*Wert3@PA ' #-- estimate model mod1 <- srm::srm(mf, data = dat, rrgroup_name="Group", conv_par=1e-4) summary(mod1) coef(mod1) #- use stats::nlminb() optimizer mod1 <- srm::srm(mf, data = dat, rrgroup_name="Group", optimizer="nlminb", conv_par=1e-4) summary(mod1)
############################################################################# # EXAMPLE 1: Univariate SRM ############################################################################# data(data.srm01, package="srm") dat <- data.srm01 #-- define model mf <- ' %Person F1@A =~ 1*Wert1@A F1@P =~ 1*Wert1@P Wert1@A ~~ 0*Wert1@A + 0*Wert1@P Wert1@P ~~ 0*Wert1@P %Dyad F1@AP =~ 1*Wert1@AP F1@PA =~ 1*Wert1@PA Wert1@AP ~~ 0*Wert1@AP + 0*Wert1@PA Wert1@PA ~~ 0*Wert1@PA ' #-- estimate model mod1 <- srm::srm(mf, data = dat, rrgroup_name="Group", conv_par=1e-4, maxiter=20) summary(mod1) round(coef(mod1),3) ############################################################################# # EXAMPLE 2: Bivariate SRM ############################################################################# data(data.srm01, package="srm") dat <- data.srm01 #-- define model mf <- ' %Person F1@A =~ 1*Wert1@A F1@P =~ 1*Wert1@P F2@A =~ 1*Wert2@A F2@P =~ 1*Wert2@P Wert1@A ~~ 0*Wert1@A + 0*Wert1@P Wert1@P ~~ 0*Wert1@P Wert2@A ~~ 0*Wert2@A + 0*Wert2@P Wert2@P ~~ 0*Wert2@P %Dyad F1@AP =~ 1*Wert1@AP F1@PA =~ 1*Wert1@PA F2@AP =~ 1*Wert2@AP F2@PA =~ 1*Wert2@PA Wert1@AP ~~ 0*Wert1@AP + 0*Wert1@PA Wert1@PA ~~ 0*Wert1@PA Wert2@AP ~~ 0*Wert2@AP + 0*Wert2@PA Wert2@PA ~~ 0*Wert2@PA ' #-- estimate model mod1 <- srm::srm(mf, data = dat, rrgroup_name="Group", conv_par=1e-4, maxiter=20) summary(mod1) ############################################################################# # EXAMPLE 3: One-factor model ############################################################################# data(data.srm01, package="srm") dat <- data.srm01 #-- define model mf <- ' # definition of factor for persons and dyad %Person f1@A=~Wert1@A+Wert2@A+Wert3@A f1@P=~Wert1@P+Wert2@P+Wert3@P %Dyad f1@AP=~Wert1@AP+Wert2@AP+Wert3@AP # define some constraints Wert1@AP ~~ 0*Wert1@PA Wert3@AP ~~ 0*Wert3@PA ' #-- estimate model mod1 <- srm::srm(mf, data = dat, rrgroup_name="Group", conv_par=1e-4) summary(mod1) coef(mod1) #- use stats::nlminb() optimizer mod1 <- srm::srm(mf, data = dat, rrgroup_name="Group", optimizer="nlminb", conv_par=1e-4) summary(mod1)
Provides least squares estimation of the bivariate social relations model with missing completely at random data (Bond & Malloy, 2018a). The code is basically taken from Bond and Malloy (2018b) and rewritten for reasons of computation time reduction.
srm_arbsrm(data, serror = TRUE, use_srm = TRUE) ## S3 method for class 'srm_arbsrm' coef(object, ...) ## S3 method for class 'srm_arbsrm' summary(object, digits=3, file=NULL, ...)
srm_arbsrm(data, serror = TRUE, use_srm = TRUE) ## S3 method for class 'srm_arbsrm' coef(object, ...) ## S3 method for class 'srm_arbsrm' summary(object, digits=3, file=NULL, ...)
data |
Rectangular dataset currently containing only one round robin group.
Bivariate observations are stacked one below the other (see
example dataset |
serror |
Logical indicating whether standard errors should be calculated. |
use_srm |
Logical indicating whether the rewritten code ( |
object |
Object of class |
file |
Optional file name for summary output |
digits |
Number of digits after decimal in summary output |
... |
Further arguments to be passed |
List containing entries
par_summary |
Parameter summary table |
est |
Estimated parameters (as in Bond & Malloy, 2018b) |
se |
Estimated standard errors (as in Bond & Malloy, 2018b) |
If you use this function, please also cite Bond and Malloy (2018a).
Rewritten code of Bond and Malloy (2018b). See http://thomasemalloy.org/arbsrm-the-general-social-relations-model/ and http://thomasemalloy.org/wp-content/uploads/2017/09/arbcodeR.pdf.
Bond, C. F., & Malloy, T. E. (2018a). Social relations analysis of dyadic data structure: The general case. In T. E. Malloy. Social relations modeling of behavior in dyads and groups (Ch. 14). Academic Press. doi:10.1016/B978-0-12-811967-9.00014-X
Bond, C. F., & Malloy, T. E. (2018b). ARBSRM - The general social relations model. http://thomasemalloy.org/arbsrm-the-general-social-relations-model/.
Without missing data, ANOVA estimation can be conducted with the TripleR package.
############################################################################# # EXAMPLE 1: Bond and Malloy (2018) illustration dataset ############################################################################# data(data.bm2, package="srm") dat <- data.bm2 #- estimation mod1 <- srm::srm_arbsrm(dat) mod1$par_summary coef(mod1) summary(mod1) #-- estimation with original Bond and Malloy code mod1a <- srm::srm_arbsrm(dat, use_srm=FALSE) summary(mod1a)
############################################################################# # EXAMPLE 1: Bond and Malloy (2018) illustration dataset ############################################################################# data(data.bm2, package="srm") dat <- data.bm2 #- estimation mod1 <- srm::srm_arbsrm(dat) mod1$par_summary coef(mod1) summary(mod1) #-- estimation with original Bond and Malloy code mod1a <- srm::srm_arbsrm(dat, use_srm=FALSE) summary(mod1a)
Data from Warner et al. (1979)
data(Warner)
data(Warner)
A data frame with 56 measurements of a single round-robin group on a single round-robin
variable that was measured at three consecutive time points. The variable reflects the
proportion of time an actor spent when speaking to a partner.
prop.T1
: proportion of time spent in the first interaction prop.T2
: proportion of time spent in the second interaction prop.T3
: proportion of time spent in the third interaction
See Table 7 (p. 1752) of the Warner et al. (1979).
Warner, R. M., Kenny, D. A., & Soto, M. (1979). A new round robin analysis of variance for social interaction data. Journal of Personality and Social Psychology, 37(10), 1742-1757. doi:10.1037/0022-3514.37.10.1742
Data from Study 3 of Albright et al. (1988)
data(Zero)
data(Zero)
A data frame with 636 measurements of 36 round robin groups on the following 15 round-robin
variables (taken on 7-point rating scales with higher values indicating more of the
trait):
sociable
: rating of dimension sociable-reclusive good
: rating of dimension good-natured-irritable responsible
: rating of dimension responsible-undependable calm
: rating of dimension calm-anxious intellectual
: rating of dimension intellectual-unintellectual imaginative
: rating of dimension imaginative-unimaginative talkative
: rating of dimension talkative-silent fussy
: rating of dimension fussy-careless composed
: rating of dimension composed-excitable cooperative
: rating of dimension cooperative-negativistic physically_attractive
: rating of dimension physically attractive-unattractive formal_dress
: rating of dimension formal dress-casual dress neatly_dressed
: rating of dimension neatly dressed-sloppy dress athletic
: rating of dimension athletic-not athletic young
: rating of dimension young-old
The data frame also contains the gender (actor.sex
; 1
= F,
2
= M) of the participants and their self-ratings on the five assessed traits
(actor.sociable
and so on).
http://davidakenny.net/srm/srmdata.htm
Albright, L., Kenny, D. A., & Malloy, T. E. (1988). Consensus in personality judgments at zero acquaintance. Journal of Personality and Social Psychology, 55(3), 387-395. doi:10.1037/0022-3514.55.3.387