if (FALSE) {
# example 1: analysis on determinants of anger-related behavior
# load anger data
data(anger)
# compute 5 runs of disjunctive latent class probabilistic feature model
# with 4 features and 2 latent classes
# assume constant situation classification per person
# and class-specific situation parameters (i.e. model=1)
anger.m1<-LCplfm(data=anger$data,F=4,T=2,maprule="disj",
M=5,emcrit1=1e-3,emcrit2=1e-8,model=1)
# visualize object and attribute parameters
# of both classes per feature in one figure
par(mfrow=c(2,2),pty="s")
plot(anger.m1,element="attribute",feature=1, main="Feature 1",
minpositionlabel=-2, positionlabel=-1)
plot(anger.m1,element="attribute",feature=2, main="Feature 2",
minpositionlabel=-2, positionlabel=-1)
plot(anger.m1,element="attribute",feature=3, main="Feature 3",
minpositionlabel=-2, positionlabel=-1)
plot(anger.m1,element="attribute",feature=4, main="Feature 4",
minpositionlabel=-2, positionlabel=-1)
par(mfrow=c(2,2),pty="s")
plot(anger.m1,element="object",feature=1,main="Feature 1",
minpositionlabel=-1.5, positionlabel=-1, y.intersplegend=0.7)
plot(anger.m1,element="object",feature=2,main="Feature 2",
minpositionlabel=-1.5, positionlabel=-1, y.intersplegend=0.7)
plot(anger.m1,element="object",feature=3,main="Feature 3",
minpositionlabel=-1.5, positionlabel=-1, y.intersplegend=0.7)
plot(anger.m1,element="object",feature=4,main="Feature 4",
minpositionlabel=-1.5, positionlabel=-1, y.intersplegend=0.7)
# compute 5 runs of disjunctive latent class probabilistic feature model
# with 2 features and 2 latent classes
# assume constant situation classification per person
# and class-specific situation and behavior parameters (i.e. model=3)
anger.m3<-LCplfm(data=anger$data,F=2,T=2,maprule="disj",
M=5,emcrit1=1e-3,emcrit2=1e-8,model=3)
# visualize object and attribute parameters of feature 1,2
# for class 1
par(mfrow=c(2,2))
plot(anger.m3,element="attribute",feature=1, class=1,main="Feature 1, class 1",
minpositionlabel=-2, positionlabel=-1)
plot(anger.m3,element="attribute",feature=2, class=1,main="Feature 2, class 1",
minpositionlabel=-2, positionlabel=-1)
plot(anger.m3,element="object",feature=1, class=1,main="Feature 1, class 1",
minpositionlabel=-2, positionlabel=-1)
plot(anger.m3,element="object",feature=2, class=1,main="Feature 2, class 1",
minpositionlabel=-2, positionlabel=-1)
# visualize object and attribute parameters of feature 1,2
# for class 2
par(mfrow=c(2,2))
plot(anger.m3,element="attribute",feature=1, class=2,main="Feature 1, class 2",
minpositionlabel=-1.7, positionlabel=-1, y.intersplegend=0.7)
plot(anger.m3,element="attribute",feature=2, class=2,main="Feature 2, class 2",
minpositionlabel=-1.7, positionlabel=-1, y.intersplegend=0.7)
plot(anger.m3,element="object",feature=1, class=2,main="Feature 1, class 2",
minpositionlabel=-1.7, positionlabel=-1, y.intersplegend=0.7)
plot(anger.m3,element="object",feature=2, class=2,main="Feature 2, class 2",
minpositionlabel=-1.7, positionlabel=-1, y.intersplegend=0.7)
}
Run the code above in your browser using DataLab