changeScale: Change the Scales of a quickPredict Object for an Interaction...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/variableTransformation.R

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## 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)

STAR documentation built on May 2, 2019, 11:44 a.m.