p3d-package: Visualization of models in 3D

Description Details Changes Author(s) References See Also Examples

Description

p3d is a very rough collection of functions to help visualize models that are expressed as functions of two independent variables with the addition of a possible categorical variable. It is based on an older version of scatter3d in the car package by John Fox which, in turn, uses the rgl package.

The essential idea is provided by the Plot3d function, which allows plotting a data frame via a formula of the form y ~ x + z [| g], where y is the response, x, z are independent variables and g is an optional grouping factor. In addition to generating the plot, the function saves information about the current data frame and graphics parameters in a globally accessible structure.

Following a call to Plot3d, the following can be done using simple calls:

points can be interactively labeled using Identify3d;

the fitted surfaces for other related models using the same data can be added using Fit3d

graphical annotations that can be represented as a collection of line segments in 3D space can be added using Lines3d

3D data ellipsoids can be added using Ell3d

In addition, the package contains a variety of utility functions for working with 2D and 3D models, graphical enhancements and 3D geometry.

Details

Package: p3d
Type: Package
Version: 0.02-3
Date: 2011-10-28
License: GPL version 2 or newer
LazyLoad: yes

A simple example below illustrates the major features of p3d.

Changes

Lines3d.default: 2009-05-09: disabled line changing 'lwd' to 'size' since 'segments3d' uses 'lwd'.

Author(s)

Georges Monette

Maintainer: Georges Monette <[email protected]>

References

Monette, G. (1990), Geometry of Multiple Regression and Interactive 3-D Graphics, In Fox, J. & Long, S. (ed.), Modern Methods of Data Analysis, Sage Publications, 209-256.

See Also

rgl

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
  library(p3d)
  library(car)

  data(Prestige)

  fit <- lm( women ~ education * prestige * type, Prestige)

  Init3d()
  Plot3d( women ~ education + prestige | type, Prestige)
  Fit3d( fit )
  fit2 <- lm( women ~ education + prestige, Prestige)
  Fit3d( fit2, col = 'red')
  Ell3d()

## End(Not run)

p3d documentation built on May 2, 2019, 5:25 p.m.