Home > database >  Multiple Variables Curve Plot
Multiple Variables Curve Plot

Time:10-04

I have a dataset of three X variables (X1,X2,X3) and one Y variable (Y). The range of the X variables is (-4 - 4) and Y (400 - 540).

Sample of dataset can be generated below

df1 <- data.frame( Y = rnorm(1000,400:450),
           X1 = rnorm(1000,-4:5),
           X2 = rnorm(1000,-4:5),
           X3 = rnorm(1000,-4:5)
           )

I wish to produce a plot where the three X variables appear like curves and one line showing the average of Y. Exactly like this enter image description here

  • Related