Learn R Programming

seeg (version 1.0)

GOF: Functions to explore and determine GOF

Description

Functions to explore and determine GOF.

Usage

cdf.plot(x)
cdf.plot.gof(x,dist="normal",mu=0,sd=1,rate=1,min=0,max=1,shape=1,scale=1)
chisq.gof.norm(x, nclass, param.est)

Arguments

x
data for one variable
dist
distribution
mu
mean for normal dist
sd
standard deviation for normal dist
rate
rate parameter for exponential dist
min
minimum for uniform dist
max
maximum for uniform dist
shape
shape parameter for Weibull dist
scale
scale parameter for Weibull dist
nclass
number of bins for chisquare test
param.est
number of estimated parameter (to calculate df)

Value

  • Fx.EmpCDF Empirical
  • Fx.TheoCDF Theoretical
  • Fx.DiffCDF Empirical minus CDF Theoretical
  • X2Chisquare
  • dfDegrees of freedom
  • p.valuep-value
  • observedObservations in each class

Details

cdf.plot: Compare CDF empirical and theoretical for normal cdf.plot.gof: Compare CDF empirical and theoretical for Normal, Uniform, Exponential, and Weibull. chisq.gof.norm: Determines GOF to a normal by Chisq

References

Acevedo M.F. 2013. "Data Analysis and Statistics for Geography, Environmental Science, and Engineering", CRC Press.

See Also

EDA functions eda6, ECDF stats ecdf, GOF tests ks.test, Shapiro test shapiro.test

Examples

Run this code
x <- rnorm(100)
cdf.plot(x)

x <- runif(100)
cdf.plot(x)

xn <- rnorm(20)
cdf.plot.gof(xn,dist="normal")
mtext(side=3,line=2,"Sample Normal, Hyp Normal",cex=0.7)

xu <- runif(20,0,1)
cdf.plot.gof(xu,dist="unif")
mtext(side=3,line=2,"Sample Unif, Hyp Unif",cex=0.7)

z <- rnorm(100)
chisq.gof.norm(z,4,0)

Run the code above in your browser using DataLab