Skip to content

Commit

Permalink
Fix wrong position of raw data points in binary case
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix.S committed Feb 8, 2017
1 parent b090465 commit cb17890
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions R/plot.RSA.R
Original file line number Diff line number Diff line change
Expand Up @@ -382,16 +382,25 @@ plotRSA <- function(x=0, y=0, x2=0, y2=0, xy=0, w=0, wx=0, wy=0, x3=0, xy2=0, x2
logit <- function (x) {log(x/(1-x))}
invlogit <- function (x) {1/(1+exp(-x))}
link <- match.arg(link, c("identity", "logit", "probit"))
if (link == "probit") {
if (link == "probit") {
# surface
z.trans <- 1.7 * new2$z
new2$z <- invlogit(z.trans)

zpoints.trans <- 1.7 * zpoints
zpoints <- invlogit(zpoints.trans)
# raw data points
if (points$value == "predicted") {
zpoints.trans <- 1.7 * zpoints
zpoints <- invlogit(zpoints.trans)
}
}
if (link == "logit") {
# surface
new2$z <- invlogit(new2$z)
zpoints <- invlogit(zpoints)

# raw data points
if (points$value == "predicted") {
zpoints <- invlogit(zpoints)
}
}


Expand Down

0 comments on commit cb17890

Please sign in to comment.