get_effects_dist: A function to estimate the parameters of an RSiena model many...

Description Usage Arguments Examples

View source: R/get-effects-dist.R

Description

A function to estimate the parameters of an RSiena model many times. Returns a data frame of estimates.

Usage

1
get_effects_dist(dat, struct, N)

Arguments

dat

A Siena data object. For more information see ?RSiena::sienaDataCreate

struct

A Siena effects structure object. Include all effects you wish to include in the model. See ?RSiena::getEffects for more.

N

integer. Number of times you'd like to fit the model

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
# data set up from \url{https://www.stats.ox.ac.uk/~snijders/siena/basicRSiena.r}
library(RSiena)
friend.data.w1 <- as.matrix(read.table("data/s50-network1.dat"))
friend.data.w2 <- as.matrix(read.table("data/s50-network2.dat"))
friend.data.w3 <- as.matrix(read.table("data/s50-network3.dat"))
drink <- as.matrix(read.table("data/s50-alcohol.dat"))
friendshipData <- array(c(friend.data.w1, friend.data.w2, friend.data.w3), dim = c(50, 50, 3))
friendship <- sienaDependent(friendshipData)
alcohol <- varCovar(drink)
mydata <- sienaDataCreate(friendship, alcohol)
M1eff <- getEffects(mydata)
M2eff <- includeEffects(M1eff, jumpXTransTrip, interaction1 = "alcohol")
# M1 estimates
M1ests_bigfriends <- get_effects_dist(dat = mydata, struct = M1eff, N = 1000)
M2ests_bigfriends <- get_effects_dist(dat = mydata, struct = M2eff, N = 1000)

## End(Not run)

sctyner/netvizinf documentation built on May 29, 2019, 4:20 p.m.