Skip to contents

Function to simulate big data under linear, logistic and Poisson regression for sampling. Covariate data X is through Normal or Uniform distribution for linear regression. Covariate data X is through Exponential or Normal or Uniform distribution for logistic regression. Covariate data X is through Normal or Uniform distribution for Poisson regression.

Usage

GenGLMdata(Dist,Dist_Par,No_Of_Var,Beta,N,family)

Arguments

Dist

a character value for the distribution "Normal" or "Uniform or "Exponential"

Dist_Par

a list of parameters for the distribution that would generate data for covariate X

No_Of_Var

number of variables

Beta

a vector for the model parameters, including the intercept

N

the big data size

family

a character vector for "linear", "logistic" and "poisson" regression from Generalised Linear Models

Value

The output of GenGLMData gives a list of

Basic a list of outputs based on the inputs and Beta Estimates for all models

Complete_Data a matrix for Y and X

Details

Big data for the Generalised Linear Models are generated by the "linear", "logistic" and "poisson" regression types.

We have limited the covariate data generation for linear regression through normal and uniform distribution, logistic regression through exponential, normal and uniform and Poisson regression through normal and uniform distribution.

References

Lee Y, Nelder JA (1996). “Hierarchical generalized linear models.” Journal of the Royal Statistical Society Series B: Statistical Methodology, 58(4), 619--656.

Examples

Dist<-"Normal"; Dist_Par<-list(Mean=0,Variance=1,Error_Variance=0.5)
No_Of_Var<-2; Beta<-c(-1,2,1); N<-5000; Family<-"linear"
Results<-GenGLMdata(Dist,Dist_Par,No_Of_Var,Beta,N,Family)

Dist<-"Normal"; Dist_Par<-list(Mean=0,Variance=1)
No_Of_Var<-2; Beta<-c(-1,2,1); N<-5000; Family<-"logistic"
Results<-GenGLMdata(Dist,Dist_Par,No_Of_Var,Beta,N,Family)

Dist<-"Normal";
No_Of_Var<-2; Beta<-c(-1,2,1); N<-5000; Family<-"poisson"
Results<-GenGLMdata(Dist,NULL,No_Of_Var,Beta,N,Family)