1

I am experimenting with scatter3d from car package. My code is the following:

library(car)
x <- sample(20 : 100, size = 1000, replace = TRUE)
z <- sample (20:100, size = 1000, replace = TRUE)
y <- (2/3)*x^(3/2) - (z^2)/6 + x * z/3  - 1 /(x/1000 * z/10)
q <- quantile(y, probs=c(0.001, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.999 ))
p <- as.numeric((y > q[2] & y < q[3]) | (y > q[6] & y < q[7]))
scatter3d(p ~ x + z, grid = FALSE, groups = as.factor(p), surface = FALSE)
scatter3d(p ~ x + z, grid = FALSE, fit = "smooth")

The output is the following:

Scatterplot without a Smooth Surface

Scatterplot with Smooth Surface

My question is how to interpret the Smooth surface --given that the dependent is binary? Should I interpret it as a probability? However its height is not limited to the range [0,1].

Or perhaps, I should not use a smooth surface with a binary variable?

Your advice will be appreciated.

rf7
  • 1,993
  • 4
  • 21
  • 35

0 Answers0