View source: R/2a_parameter_estimation_functions.R
use_generalised_linear_model | R Documentation |
############################################################################ Get the parameter values using logistic regression
use_generalised_linear_model(
param_to_be_estimated,
dataset,
indep_var,
family,
covariates,
interaction,
naaction,
link = NA
)
param_to_be_estimated |
parameter of interest |
dataset |
data set to be provided |
indep_var |
the independent variable (column name in data file) |
family |
distribution name eg. for logistic regression -binomial |
covariates |
list of covariates-calculations to be done before passing |
interaction |
boolean value to indicate interaction in the case of linear regression |
naaction |
action to be taken with the missing values |
link |
link function if not the default for each family |
This function returns the results and plots after doing linear regression Requires param to be estimated, dataset, independent variables and information on covariates, and interaction variables if there are Uses form_expression_glm to create the expression as per R standard for e.g glm(y ~ x ). Returns the fit result,s summary results as returned by summary(), confidence interval for fit coefficients (ci_coeff), variance covariance matrix, cholesky decomposition matrix, results from correlation test, plot of diagnostic tests and model fit assumptions, plot of model prediction diagnostic include AIC, R2, and BIC. The results of the prediction ie predicted values for fixed other variables will be returned in prediction matrix
the results of the regression analysis
gm_result <- use_generalised_linear_model(
param_to_be_estimated = "Direction",
dataset = ISLR::Smarket, indep_var = "Lag1", family = "binomial",
covariates = c("Lag2", "Lag3"),
interaction = FALSE, naaction = "na.omit", link = NA)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.