getNetworkSet: Returns a list of networks forming a longitudinal Analysis...

Description Usage Arguments Details Value Examples

Description

An Analysis Set is a set of observations satisfying a particular set of criteria to be included in an analysis. Requiring complete data is too stringent for most longitudinal analysis. This is true in both descriptive network studies (where even individuals who come and go still form part of the social context) and also SAOM and related network modeling methods (which can include partial data on individuals if MAR assumptions are met)

Usage

1
2
getNetworkSet(pWavVec, pSchVec, pElig = 1, pDid = 1, pTyp = "BF",
  pOut = "SP", pS0 = "")

Arguments

pWavVec

An ordered numeric vector of wave SIDs to be included in the analysis. Waves 2, 6, and 10 are summer waves; no Short Survey or Long Survey data were collected. Hence these waves should not ever be specified.

pSchVec

ordered integer vector of school IDs

pElig

the minimum number of eligible waves for SID to be included

pDid

the minimum number of completed waves for SID to be included

pTyp

string, defines type of network (BF => 'one of my best friends', FT => 'spent free time with')

pOut

string, type of network format for output (SP => dgTMatrix-class sparse matrix (pkg 'Matrix), NT => network-class matrix (pkg 'network'))

pS0

string; if "S0", pOut = "SP", and pWavVec includes wave 1, structural zeros are inserted in the edge list of the w1 networks between individuals in different middle schools.

Details

The schools specified will normally comprise a single network, for descriptive or analysis purposes. If they are not, for some waves, then structural zeros should be included for pairs of nodes that cannot form relationships on particular waves (e.g. if the kids went to separate middle schools, and then all attend the same high school) The 'length(pWavVec)+1st' element of the output contains a vector of the SIDs considered to be 'in the analysis' by the selection criteria implied by the input parameters. It's useful for obtaining corresponding variables such as vertex properties, RSIena covariates, and so on. This function can be used to pull networks suitable for descriptive analysis (e.g. by later converting them to 'network' objects and using 'sna') or by combining them into a SAOM network object using sienaNet (from 'RSiena') as shown in the example below.

Value

A <pWavVec>-length list of either sparse matrix (dgTMatrix class) networks, one list element per wave, with RowIDs identifying chooser and chosen, – OR – 'network' class networks (pkg 'network'), one list element per wave (also with RowIDs). The last element of the list is a vector of the SIDs to be included in the analysis (this has many uses in other package functions).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Creates a list of length 4; the first 3 elements of the list
# are dgTSparse-class matrices, one for each wave, for all the
# middle and high schools in one school district of the PInf study.
# Inclusion criteria are: eligible for 2 or more surveys, completed
# 2 or more surveys. Networks are defined as 'Best Friends'. Output
# networks are in dgTSparse format, and the Wave 1 middle schools
# have structural zeros between individuals in different schools.
netList <- getNetworkSet(pWavVec = c(1, 3, 4),
                         pSchVec = c(3, 4, 5, 6, 30),
                         pElig = 2, pDid = 2, pTyp = "BF",
                         pOut = "SP", pS0 = "S0")
# Create SAOM longitudinal network object 'myNet'
myNet <- sienaNet(netList[1:3], sparse=T)
# Even easier way, using 'makeSAOMNet' wrapper function
myNet2 <- makeSAOMNet(netList)

johninpdx/RSTools documentation built on May 19, 2019, 5:15 p.m.