#------------------------------------------------------------------------
# Example 1: Estimation with Ridge penalites
#------------------------------------------------------------------------
##Load Data
data(DTI)
## Extract values for arguments for lpeer() from given data
cca = DTI$cca[which(DTI$case == 1),]
DTI = DTI[which(DTI$case == 1),]
##1.1 Fit the model
fit.cca.peer1 = peer(Y=DTI$pasat, funcs = cca, pentype='D2', se=TRUE)
plot(fit.cca.peer1)
#------------------------------------------------------------------------
# Example 2: Estimation with structured penalites (need structural
# information about regression function or predictor function)
#------------------------------------------------------------------------
##Load Data
data(PEER.Sim1)
## Extract values for arguments for lpeer() from given data
PEER.Sim<- subset(PEER.Sim1, t==0)
K<- 100
W<- PEER.Sim[,c(3:(K+2))]
Y<- PEER.Sim[,K+3]
##Load Q matrix containing structural information
data(Q)
##2.1 Fit the model
Fit1<- peer(Y=Y, funcs=W, pentype='Decomp', Q=Q)
plot(Fit1)Run the code above in your browser using DataLab