# Loading the library and the data
library(LPE)
data(Ley)
dim(Ley)
# Gives 12488*7
# First column is ID.
# Subsetting the data
subset.Ley <- Ley[1:1000,]
subset.Ley[,2:7] <- preprocess(subset.Ley[,2:7],data.type="MAS5")
# preprocess the data
# Finding the baseline distribution of condition 1 and 2.
var.1 <- baseOlig.error(subset.Ley[,2:4], q=0.01)
median.x <- apply(subset.Ley[,2:4], 1, median)
sf.x <- smooth.spline(var.1[, 1], var.1[, 2], df = 10)
var.test <- fixbounds.predict.smooth.spline(sf.x, median.x)$y
Run the code above in your browser using DataLab