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

View source: R/response.R

responseR Documentation

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.

Usage

response(object)

## S3 method for class 'lm'
response(object)

## S3 method for class 'glm'
response(object)

## S3 method for class 'ppm'
response(object)

## S3 method for class 'kppm'
response(object)

## S3 method for class 'dppm'
response(object)

## S3 method for class 'slrm'
response(object)

## S3 method for class 'mppm'
response(object)

Arguments

object

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

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" or "lppm", 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.

Value

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

For response.ppm, response.kppm, response.dppm and response.slrm 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".

Author(s)

\adrian

.

Examples

  fit <- ppm(cells ~ x)
  response(fit)  

spatstat.core documentation built on May 18, 2022, 9:05 a.m.