Learn R Programming

seeg (version 1.0)

inventdummy: Functions to dummy datasets

Description

Functions to dummy data.

Usage

invent.mxn(m,n=5,d=1,p,f2="random")

Arguments

m
number of groups or samples
n
number of observations in each sample
d
digits for rounding the result
p
mean and sd for random or min and max for step
f2
select step or random

Value

  • xgenerated data as a matrix

Details

Generates random or step if(f2=="random") x[,i] <- rnorm(n,p[i,1],p[i,2]) if(f2=="step") x[,i] <- seq(p[i,1],p[i,2],(p[i,2]-p[i,1])/(n-1))

For one-way analysis, you can use function invent.mxn to generate different datasets and see how the results are less significant as you use means that are more similar and increase within sample standard deviation. For two-way analysis, you can use function invent.mxn to generate different datasets and see how the results are less significant as you cluster the groups and increase the "within" range.

References

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

See Also

rnorm, matrix, aov, factor, boxplot

Examples

Run this code
m<-4; n<-5
p <- matrix(c(30,1,32,1,34,1,38,1),byrow=TRUE,ncol=2)
Xr <- invent.mxn(m,n,d=1,p,f2="random")
y <- c(Xr)
f <- factor(rep(LETTERS[1:m], rep(n,m)))
f.y <- data.frame(f, y)
boxplot(y~f, data=f.y,ylab="y", xlab="f")
summary(aov(y~f, data=f.y))

Run the code above in your browser using DataLab