Last data update: 2014.03.03

R: Change the Scales of a quickPredict Object for an Interaction...
changeScaleR Documentation

Change the Scales of a quickPredict Object for an Interaction Term

Description

Designed to transform results of quickPredict obtained on interaction terms from the transformed scale (on which the variables are approximately uniformly distributed) onto the "native", linear scale.

Usage

changeScale(obj, xFct, yFct)

Arguments

obj

a quickPredict object.

xFct

a function to be applied on the xx element of obj. This function should be the qFct attribute of the function, returned by mkM2U, used to transform the variable from the "native" to the "uniform" scale.

yFct

a function to be applied on the yy element of obj. This function should be the qFct attribute of the function, returned by mkM2U, used to transform the variable from the "native" to the "uniform" scale.

Value

A quickPredict object.

Author(s)

Christophe Pouzat christophe.pouzat@gmail.com

See Also

quickPredict, plot.quickPredict

Examples

## Not run: 
data(e060824spont)
DFA <- subset(mkGLMdf(e060824spont,0.004,0,59),neuron==1)
DFA <- within(DFA,i1 <- isi(DFA,lag=1))
DFA <- DFA[complete.cases(DFA),]
m2u1 <- mkM2U(DFA,"lN.1",0,29)
m2ui <- mkM2U(DFA,"i1",0,29,maxiter=200)
DFA <- within(DFA,e1t <- m2u1(lN.1))
DFA <- within(DFA,i1t <- m2ui(i1))
with(DFA,plot(ecdf(e1t[time>29]),pch="."))
abline(a=0,b=1,col=2,lty=2)
with(DFA,plot(ecdf(i1t[time>29]),pch="."))
abline(a=0,b=1,col=2,lty=2)
m1.fit <- gssanova(event~e1t*i1t, data=subset(DFA,time>29), family="binomial", seed=20061001)
inter.pred <- m1.fit %qp% "e1t:i1t"
contour(inter.pred,what="mean",nlevels=10,col=2,lwd=2)
contour(inter.pred,what="sd",nlevels=5,col=1,lwd=1,lty=2,add=TRUE)
inter.predN <- changeScale(inter.pred,attr(m2u1,"qFct"),attr(m2ui,"qFct"))
contour(inter.predN,what="mean",nlevels=5,col=2,lwd=1)
contour(inter.predN,what="sd",nlevels=3,col=1,lwd=1,lty=2,add=TRUE)

## End(Not run)

Results