random.test.data: Radmom data generator

Description Usage Arguments Details Value Author(s) Examples

View source: R/random.test.data.R

Description

Generates datasets with random data for modelling including a dependent variable, independent variables and X,Y coordinates.

Usage

1
2
random.test.data(nrows = 10, ncols = 10, vars.no = 3, dep.var.dis = "normal", 
                xycoords = TRUE)

Arguments

nrows

an integer referring to the number of rows for a regular grid

ncols

an integer referring to the number of columns for a regular grid

vars.no

an integer referring to the number of independent variables

dep.var.dis

a character referring to the distribution of the dependent variable. Options are "normal" (default), "poisson", and "zip"

xycoords

a logical value indicating whether X,Y coordinates will be created (default) or not.

Details

The creation of a random dataset was necessary here to provide examples to some functions. However, random datasets may be used in simulation studies.

Value

a dataframe

Author(s)

Stamatis Kalogirou <stamatis@lctools.science>

Examples

1
RDF <- random.test.data(12,12,3,"poisson")

Example output

Loading required package: reshape
Loading required package: weights
Loading required package: Hmisc
Loading required package: lattice
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2

Attaching package: 'Hmisc'

The following objects are masked from 'package:base':

    format.pval, round.POSIXt, trunc.POSIXt, units

Loading required package: gdata
sh: 1: cannot create /dev/null: Permission denied
gdata: Unable to locate valid perl interpreter
gdata: 
gdata: read.xls() will be unable to read Excel XLS and XLSX files
gdata: unless the 'perl=' argument is used to specify the location of a
gdata: valid perl intrpreter.
gdata: 
gdata: (To avoid display of this message in the future, please ensure
gdata: perl is installed and available on the executable search path.)
sh: 1: cannot create /dev/null: Permission denied
gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLX' (Excel 97-2004) files.

gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLSX' (Excel 2007+) files.

gdata: Run the function 'installXLSXsupport()'
gdata: to automatically download and install the perl
gdata: libaries needed to support Excel XLS and XLSX formats.

Attaching package: 'gdata'

The following object is masked from 'package:Hmisc':

    combine

The following object is masked from 'package:stats':

    nobs

The following object is masked from 'package:utils':

    object.size

The following object is masked from 'package:base':

    startsWith

Loading required package: mice
Loading required package: pscl
Classes and Methods for R developed in the
Political Science Computational Laboratory
Department of Political Science
Stanford University
Simon Jackman
hurdle and zeroinfl functions by Achim Zeileis
Loading required package: MASS

lctools documentation built on April 14, 2020, 6:04 p.m.