/UCSB_RProgrammingAndStatisticsConcepts

Template for programming and statistics concepts in R

Primary LanguageJupyter Notebook

R Programming and Statistics Concepts

Goals of the Project

  • Create templates for writing future programs related to specific statistic methods and models
  • Templates written in R coding language
    • Created in jupyter notebook with markdown

Files Included

RDesignOfExperiments.ipynb

  • Content:
    • Check ANOVA model assumptions
    • Create ANOVA equations and tables
      • One Way ANOVA/CRD Model, Two Way ANOVA/RCBD Model, Two Way Full Model with Interaction, Latin Square Incomplete Block Design, 2^k Factorial Design, (2^N, 2^k) Design
    • Least squares estimates of parameters
    • Hypothesis tests and confidence intervals for contrasts and multiple comparisons

RRegressionAnalysisConcepts.ipynb

  • Content:
    • Check linear regression assumptions
    • Transform variables with Invariance Transformation, Power Transformation, and Box-Cox Transformation
    • Identify outliers, leverage points, and influential points
    • Create multiple linear regression and polynomial regression models for numeric and categorical data
    • Hypothesis tests for significant predictors, significant categorical variables, significant interaction effects, and significant model degrees
    • Predictor selection with Stepwise Regression and Regression Subsets
    • Least squares estimates and weighted least squares estimates of coefficients
    • Confidence intervals of new responses

RTimeSeriesConcept.ipynb

  • Content:
    • Simulating ARMA models
    • Stabilizing variance with Box-Cox
    • Differencing to remove seasonality and trend
    • Calculate Autocovariance Functions, Autocorrelation Functions, and Partial Autocorrelation Functions for time series data
    • Model identification of SARIMA(P,D,Q)x(p,d,q)s using Sample Autocorrelation and Sample Partial Autocorrelation Functions
    • Comparing different models with AICC
    • Preliminary coefficient estimates with Yule-Walker Equations, Durbin-Levinson Algorithm, and Innovation Algorithm
    • Maximum likelihood estimated coefficients
    • Diagnostic checking
    • Forecasting

Acknowledgements

Thank you to my professors and TAs at UCSB in PSTAT 122, PSTAT 126, and PSTAT 174 for teaching me these coding concepts.