Learn R Programming

spatstat.model (version 3.3-1)

response: Extract the Values of the Response from a Fitted Model

Description

Given a fitted model (of any kind) extract the values of the response variable. For a point process model, the observed point pattern is extracted.

Usage

response(object)

# S3 method for lm response(object)

# S3 method for glm response(object)

# S3 method for ppm response(object)

# S3 method for kppm response(object)

# S3 method for dppm response(object)

# S3 method for slrm response(object)

# S3 method for rppm response(object)

# S3 method for mppm response(object)

Value

For response.lm and response.glm, a numeric vector, or NULL.

For

response.ppm,

response.kppm,

response.dppm,

response.slrm

and response.rppm, a two-dimensional spatial point pattern (class "ppp").

For response.mppm, a list of two-dimensional spatial point patterns (objects of class

"ppp"). The list also belongs to classes "solist" and "ppplist".

Arguments

object

A fitted model (object of class "lm", "glm", "ppm", "kppm", "dppm", "slrm", "rppm", or "mppm" or some other class).

Author

Adrian Baddeley Adrian.Baddeley@curtin.edu.au.

Details

For fitted linear models of class "lm" and fitted generalized linear models of class "glm", the numerical values of the response variable are extracted if they are available, and otherwise NULL is returned.

For fitted point process models of class "ppm", "kppm", "dppm", "slrm", "lppm" or "rppm", the original data point pattern is extracted.

For a fitted point process model of class "mppm", the list of original data point patterns is extracted.

Examples

Run this code
  fit <- ppm(cells ~ x)
  response(fit)  

Run the code above in your browser using DataLab