Skip to content

Q - scatterplot, plot function & trellis linear regressions???

4 messages · Jhope, Simon Knapp

#
Hi R-listers, 

Q1) What is the difference between the scatterplot and plot function? 

Q2) I am able to make a graph with the scatterplot function: 

scatterplot(DevelopIndex ~ Veg,
+             data = Turtle,
+             xlab = "Vegetation border (m)",
+             ylab = "Embryonic development index")

And have been successful. But I do not know if the lines are for: linear,
non-linear, mean, upper and lower limits or percentile? This shows side
boxplots and 4 lines. 

Yet this plot only has one regression line and no side boxplots?: 

EDIHTL <- lm(DevelopIndex~ HTL, data=Turtle)
xlab="High tide line (m)", ylab="Embryonic development index")
Q-3
I am trying to make a trellis of linear regressions. I want 3 windows
displaying 3 events of linear regression (two-way interactions). I have been
trying this:

require(lattice)
+             xlab = "Vegetation border",
+             ylab = "Embryonic development index")
Error in eval(expr, envir, enclos) : object 'DevelopIndex' not found

 Please advise, many thanks.
Jean

--
View this message in context: http://r.789695.n4.nabble.com/Q-scatterplot-plot-function-trellis-linear-regressions-tp4630562.html
Sent from the R help mailing list archive at Nabble.com.
#
I presume you mean car::scatterplot

A1) plot is a generic function for plotting 'things' and scatterplot
is a specific tool provided by that library

A2) from the documentation one infers that
      1) the straight line is a regression line
      2) the other lines are produced using loess
           a) the solid line is fitted to the data
           b) the dotted lines are created by: "a smoother is applied
to the root-mean-square positive and negative residuals from the loess
line to display conditional spread and asymmetry"

A3) you forgot the data argument (at least).

Cheers,
Simon
On Sat, May 19, 2012 at 11:34 AM, Jhope <jeanwaijang at gmail.com> wrote:
#
Thank you Simon, 
Yes this was in the library(car). There were no negative values in the
scatterplot graph or negative limits displayed.

Q-2 Are you sure the lines from the scatterplot are not this?:
solid green line: linear regression
solid red line: non-linear regression
upper dashed red line: upper limits 75 percentile
lower dashed red line: lower limits 25 percentile

Q-3 
I am trying to make a trellis of linear regressions but unsuccessful . I
want 3 windows displaying 3 events of linear regression (two-way
interactions). I have been trying this: 

require(lattice)
+             xlab = "Distance to vegetation border", 
+             ylab = "Embryonic development index") 
Error in eval(expr, envir, enclos) : object 'DevelopIndex' not found 

This error appears and I am not able to produce the trellis of 3 windows
displaying 3 events of linear regressions. 

Please advise
Thank you, Jean

--
View this message in context: http://r.789695.n4.nabble.com/Q-scatterplot-plot-function-trellis-linear-regressions-tp4630562p4630643.html
Sent from the R help mailing list archive at Nabble.com.
#
HI R-listers, 

Thanks for the replies I am convinced of Q 1 and 2. 

Q 3 -  I am still unsuccessful. Aeventexhumed has three events A, B and C. I
am unable to make 3 windows of scatterplot graphs side by side showing the
difference in regression of each event.  With and without lattice I have
tried, but the only graph that is produced is one graph with all three
events (A, B, and C) plotted in one window (R script below).  I want to show
the 3 Aeventexhumed events separately in 3 plots next to each other in one
window. Previously, I have been able to make this is trellis.par.set with
boxplots.
+             data = data.to.analyze,
+             xlab ="Distance to vegetation border",
+             ylab = "Hatching success (%)")

Please advise, Jean

--
View this message in context: http://r.789695.n4.nabble.com/Q-scatterplot-plot-function-trellis-linear-regressions-tp4630562p4630686.html
Sent from the R help mailing list archive at Nabble.com.