plot.sprunstest: Plot the empirical distribution of runs

Description Usage Arguments Details Author(s) See Also Examples

View source: R/plot.sprunstest.R

Description

Plot the empirical distribution of runs

Usage

1
2
## S3 method for class 'sprunstest'
plot.sprunstest(srq = srq)

Arguments

srq

A object of class sprunstest.

...

further arguments passed to or from other methods.

Details

Plot the histogram with the empirical distribution of the runs

Author(s)

Fernando López fernando.lopez@upct.es
Román Mínguez roman.minguez@uclm.es
Antonio Páez paez@gmail.com
Manuel Ruiz manuel.ruiz@upct.es

See Also

sp.runs.test.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Fastfood example. sf (points)
data("FastFood")
x <- cbind(FastFood.sf$Lon,FastFood.sf$Lat)
listw <- spdep::knearneigh(x, k = 2)
formula <- ~ Type
srq <- sp.runs.test(formula = formula, data = FastFood.sf, listw = listw, nsim = 299)
plot(srq)

# Spain example (poligons with 0 neinghbourhood)
data("Spain")
listw <- spdep::poly2nb(as(spain.sf,"Spatial"), queen = FALSE)
formula <- ~ Older65
srq <- sp.runs.test(formula = formula, data = spain.sf, listw = listw, nsim = 299)
plot(srq)
formula <- ~ MenWoman
srq <- sp.runs.test(formula = formula, data = spain.sf, listw = listw, nsim = 299)
plot(srq)

rominsal/spqdata documentation built on Jan. 24, 2021, 11:11 a.m.