Skip to content

lines in 3d-cloud plot (lattice)

3 messages · Paul Murrell, root, John Fox

#
Hi

Staying with Trellis graphics, and depending on what sort of lines you 
want to add, you could do something similar to persp() example # 2 using 
cloud() by writing your own panel.3d.cloud() function, which calls 
panel.3dscatter() and then does some further drawing.  This is an 
analogue to "the sequence plot(), followed by points() or
lines() in the base plotting functions", all done within a lattice panel 
function.  From a quick look at help(panel.cloud) it looks like the 
required transformation information is available via something like 
ltransform3dto3d().

Paul
Tom Blackwell wrote:

  
    
1 day later
#
Does anyone know a rough equivalent of the r-squared statistic for lines or
surfaces fitted to data using local smoothing (eg. using the sm or locfit
libraries)? I feel there must be some manner in which such locally-smoothed
figures explain a fraction of the total squared error in the data...  Can
such a fraction be obtained from locfit (or sm) objects?

Stuart

Dr Stuart Leask DM MRCPsych, Senior Lecturer in Clinical Psychiatry
University Dept of Psychiatry, Duncan Macmillan House
Porchester Road, Nottingham. NG3 6AA. UK
http://www.nottingham.ac.uk/psychiatry/staff/s_leask.html
#
Dear Stuart,

Since residuals(mod) works for models fit by locfit(), you could calculate 
an analog to R^2 as 1 - (sum(residuals(mod)^2)/sum((y - mean(y))^2). I'm 
not sure whether you can get residuals from sm.

I hope that this helps,
  John
At 03:44 PM 2/3/2004 +0000, Stuart Leask wrote:
____________________________
John Fox
Department of Sociology
McMaster University
email: jfox at mcmaster.ca
web: http://www.socsci.mcmaster.ca/jfox