-
Notifications
You must be signed in to change notification settings - Fork 13
/
README.Rmd
75 lines (58 loc) · 1.89 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# dyadr
[![Travis-CI Build Status](https://api.travis-ci.org/abarylsky/dyadr.svg?branch=master)](https://travis-ci.org/abarylsky/dyadr)
r package for dyadic data analysis
# Description
An R package for assisting people in dyadic data analysis. Contains functions to organize output from the `gls` and `lme` functions from the `nlme` package for cross-sectional data. Some functionality exists with the `lme4` package. Improves user understanding of the Actor-Partner Independence Model by organizing actor and parter effects for the purpose of comparing parameters to each other.
# Installation
```{r, eval=FALSE}
# install.packages("devtools")
devtools::install_github("RandiLGarcia/dyadr")
```
# Usage
Here is an example of how to use some of the `dyadr` functions.
First, load the package and get data:
```{r, warning = FALSE}
library(nlme)
library(dyadr)
```
Using the `smallsummary` function
```{r}
apim <- gls(Satisfaction_A ~ Tension_A + SelfPos_P,
na.action = na.omit,
correlation = corCompSymm(form = ~ 1 | CoupleID),
data = acipair
)
smallsummary(apim)
```
Using the `crsp` function
```{r}
# Empty Model
apimie <- summary(gls(Satisfaction_A ~ 1,
na.action = na.omit,
correlation = corCompSymm(form = ~ 1 | CoupleID),
data = acipair
))
# sd of errors for the model or esd
esd <- as.numeric(apim[6])
# sd of errors for the empty model or esd0
esd0 <- as.numeric(apimie[6])
# the R squared, using the crsp function
crsp(esd, esd0)
```
# Contributing
Feel free to submit pull requests resolving documented issues.
# Authors
* **Randi L. Garcia** - *Initial work* - [dyadr](https://github.com/RandiLGarcia/dyadr)
* **David A. Kenny** - *Initial work*