linkedLives: non-standardization test for lifecourses of linked lives

Description Usage Arguments Author(s) Examples

View source: R/linkedLives.R

Description

The non-standardization test for lifecourses with linked lives. The simulations carried out for this test account for the fact that some individuals are more likely to have identical lifecourse trajectories. Acknowledgements: CPC St Andrews/Edinburgh.

Usage

1
linkedLives(currentData, sequenceUnits, lifecourseSequences)

Arguments

currentData

Dataset containing a sequence of linking ID's (such as house ID's).

sequenceUnits

Vector containing the sequence alphabet.

lifecourseSequences

Dataset containing the sequences under invetigation.

Author(s)

Glenna Nightingale

Examples

 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
data(myHouseID)
data(mydata)
#------Exploring data---------
length(unique(myHouseID[,2])) 
# number of unique individuals represented = 64
length((myHouseID[,2]))
# number of individuals in dataset = 100
length(myHouseID[,2]) 
# number of individuals represented = 100
hist(myHouseID[1:10,2],col="blue")
# plotting the first 10 house ID's
# Frequencies greater than 1 indicate individuals
# with the same house ID.
#--------------

#----- Running Function------------------
#B = linkedLives(myHouseID[,2:14],c("non-mover","mover within gb"),mydata[,2:14])
# the first column of the myHouseID and mydata
# datasets contain personal ID's
#----------------------------------------

#---- Plotting----------------------------
#hist(B[[1]],col="red",xlab="Simulated test statistics"
#,ylab="Frequency",main="Results of non-standardization test",
#cex.lab=1.5,xlim=c(range(B[[1]])[1],B[[4]]))
#abline(v=B[[4]],lwd=3,col="orange")
#B[[2]]# pval (Left tailed)
#B[[3]]# pval (Right tailed)
#B[[4]]# Empirical test statistic
#----------------------------------

lifecourse documentation built on May 2, 2019, 4:18 a.m.