Vito Ricci - R Functions For Regression Analysis – 14/10/05 (vito_ricci@yahoo.com)
R FUNCTIONS FOR REGRESSION ANALYSIS
Here are some helpful R functions for regression analysis grouped by their goal. The name of package is in parentheses.
Linear model
Anova: Anova Tables for Linear and Generalized Linear Models (car) anova: Compute an analysis of variance table for one or more linear model fits (stasts) coef: is a generic function which extracts model coefficients from objects returned by modeling functions. coefficients is an alias for it (stasts) coeftest: Testing Estimated Coefficients (lmtest) confint: Computes confidence intervals for one or more parameters in a fitted model. Base has a method for objects inheriting from class "lm" (stasts) deviance:Returns the deviance of a fitted model object (stats) effects: Returns (orthogonal) effects from a fitted model, usually a linear model. This is a generic function, but currently only has a methods for objects inheriting from classes "lm" and "glm" (stasts) fitted: is a generic function which extracts fitted values from objects returned by modeling functions fitted.values is an alias for it (stasts) formula: provide a way of extracting formulae which have been included in other objects (stasts) linear.hypothesis: Test Linear Hypothesis (car) lm: is used to fit linear models. It can be used to carry out regression, single stratum analysis of variance and analysis of covariance (stasts) model.matrix: creates a design matrix (stasts) predict: Predicted values based on linear model object (stasts) residuals: is a generic function which extracts model residuals from objects returned by modeling functions (stasts) summary.lm: summary method for class "lm" (stats) vcov: Returns the variance-covariance matrix of the main parameters of a fitted model object (stasts)
Model – Variables selection add1: Compute all the single terms in the scope argument that can be added to or dropped from the model, fit those models and compute a table of the changes in fit (stats) AIC: Generic function calculating the Akaike information criterion for one or several fitted model objects for which a log-likelihood value can be obtained, according to the formula -2*log-likelihood + k*npar, where npar represents the number of parameters in the fitted model, and k = 2 for the usual AIC, or k = log(n) (n the number of observations) for the so-called BIC or SBC (Schwarz's Bayesian criterion) (stats) Cpplot: Cp plot (faraway) drop1: Compute all the single terms in the scope argument that can be added to or dropped from the model, fit those models and compute a table of the changes in fit (stats) extractAIC: Computes the (generalized) Akaike An Information Criterion for a fitted parametric model (stats) leaps: Subset selection by `leaps and bounds' (leaps) maxadjr: Maximum Adjusted R-squared (faraway) offset: An offset is a term to be added to a linear predictor, such as in a generalised linear model, with known coefficient 1 rather than an estimated coefficient (stats) step: Select a formula-based model by AIC (stats) update.formula: is used to update model formulae. This typically involves adding or dropping terms, but updates can be more general (stats) 1
Vito Ricci - R Functions For Regression Analysis – 14/10/05 (vito_ricci@yahoo.com)
Diagnostics cookd: Cook's Distances for Linear and Generalized Linear Models (car) cooks.distance: Cook’s distance (stats) covratio: covariance ratio (stats) dfbeta: DBETA (stats) dfbetas: DBETAS (stats) dffits: DFFTITS (stats) hat: diagonal elements of the hat matrix (stats) hatvalues: diagonal elements of the hat matrix (stats) influence.measures: This suite of functions can be used to compute some of the regression (leave-one-out deletion) diagnostics for linear and generalized linear models (stats) lm.influence: This function provides the basic quantities which are used in forming a wide variety of diagnostics for checking the quality of regression fits
Chapter 4 – Functions 1. INTRODUCTION As with “set” the concept of “function” is of fundamental importance in mathematics. It permeates all branches of the subject from elementary algebra to quantum mechanics. The following discussion will be restricted to functions defined on sets of real numbers only. 1.1 Definitions and Examples We are all familiar with the idea of the dependence of the value of one quantity, y, on the value of another, x, usually determined by a formula. For…
completed in 180 degrees and share 2 features. The n of theta in formulas, r=cos n theta and r=sin n theta, in 6 formulas are 1 and all graphs have circles for the first set. All 6 circles in the first set touch its point at the origin hit the opposite end of the origin, which the points of the other end of the origin depend on the coefficients of theta. The next set of 6 graphs are cosine functions in which the n of the function, r=cos n theta, are odd. The graphs in the second set are completed in 180…
the compound interest formula—such as would be used to calculate a car loan—an example of a function? If yes, of what type of function is it an example? Why might you identify it with that type of function? Response Yes the compound interest formula—such as would be used to calculate a car loan is an example of a function.The Compound Interest Formula is A = p(1 + r/n)^(nt). This is a function, because for each value in the domain (your input values) there will only be one value in the…
A63 –A70) • Linear Models: Building Linear Functions from Data (Section 3.2, pp. 140–143) Now Work the ‘Are You Prepared?’ problems on page 164. OBJECTIVES 1 Build Quadratic Models from Verbal Descriptions (p. 159) 2 Build Quadratic Models from Data (p. 163) In this section we will first discuss models in the form of a quadratic function when a verbal description of the problem is given. We end the section by fitting a quadratic function to data, which is another form of modeling.…
DISCRETE MATHEMATICS AND ITS APPLICATIONS by Kenneth H. Rosen Chapter 1 -- The Foundations: Logic and Proof, Sets, and Functions 1.1 Logic A proposition is a statement that is either true or false, but not both. ( p ) Propositional logic is the area of logic that deals with propositions. A truth table displays the relationships between the truth values of propositions. Logical operators: Negation ( ( p, not p ) Conjunction ( p ( q, p and q ) Disjunction ( p ( q, p or q…
columns and rows. We thus treat these games as games with continuous strategies as well. To solve simultaneous games with continuous strategies, we first derive each player’s best response function. A Nash Equilibrium occurs when each player is playing her best response, i.e., where the best response functions intersect. 2 / 45 Continuous Strategies Example: Guessing half of the average Consider a game called “Guessing half of the average” Two players can choose any number between 0 and 100 including…
21 Periodic Functions & Applications – “Tide’s out!” Bevan Dias Mr. O’Keefe 12A Year 12 Mathematics B Year 12 Mathematics B, Periodic Functions & Applications “Tide’s out!” Table of Contents 1.0 Water-‐depth data ..................................................................................................... 3 2.0 Graph of water depth…
N O D M I R G F D A I O Q N G L A E B A S A L O S D U Y N B F G H L K S K W B Z E K S S C V E U O Y P J D X B F Y O L D P J T A G A S W Q X D K J N A T D F B C I L B F L W E F P E A S G M Z R G V R N G P L A D C F H D R H V N Q A A H O O F L T C D B D A G H C B M T U S C N A N H O R U U P R Z V C D F H L B M H W K C J T T S H Y C O A I A S D G K V E C G H K T V G N B L K N W T F D B M U A N Q I L I E X J D R T Y C J Y Y T W E X V I O Q S I K M N F S A Q H Q W E R T Y U W L W D G O A D S Y U I K U…