Publications by Miguel Arquez Abdala
Intermediate R
String comparison String comparison is based on alphabetical order "Hello" > "GoodBye" ## [1] TRUE Logical operators AND operator & OR operator | NOT operator ! # Every element compared with the their c(TRUE, TRUE, FALSE) & c(TRUE, FALSE, FALSE) ## [1] TRUE FALSE FALSE # (AND operator) Only examinates the first element of each vector c(TRU...
745 sym R (9119 sym/77 pcs)
ShinyApps
How does a web app work? A web app is a thing that updates based on user input/interaction. Most web apps have two parts: Client or user interface (UI): users interact with. Server or Backend: where carries out computations or searches based on the user interactions Shiny Shiny is an R package that allows you to write web applications. library(...
3122 sym R (745 sym/5 pcs)
ROC Curves
library("pROC") library("randomForest") set.seed(420) num_samples <- 100 weight <- sort(rnorm(n = num_samples, mean = 172, sd = 29)) obese <- ifelse(test = (runif(n = num_samples) < (rank(weight)/100)), yes = 1, no = 0) plot(x = weight, y = obese) glm_fit <- glm(obese ~ weight, family = "binomial") plot(x = weight, y = ...
155 sym R (3497 sym/22 pcs) 5 img
ETS and Exponetial smoothing
A diferencia de los métodos naive y de medias móviles, el suavizamiento exponencial le da más peso a observaciones más recientes. library("tidyverse") library("fpp2") # create training and validation of the Google stock data goog.train <- window(goog, end = 900) goog.test <- window(goog, start = 901) # create training and validation of t...
5899 sym R (11025 sym/50 pcs) 14 img
Moving averages
library("tidyverse") library("lubridate") library("fpp2") library("zoo") Las medias móviles son métodos de suaviamiento por ventanas (donde la medida de cálculo es el promedio) SMA (simple moving average) Promedio simple de un número de periodos específico de 5 periodos: \[ y_{t} = \frac{y_{t-2}+y_{t-1}+y_{t}+y_{t+1}+y_{t+2}}{5} \] P...
2445 sym R (4709 sym/23 pcs) 5 img
Times Series EDA
library("forecast") library("fpp2") Al trabajar con series de tiempo en R debemos convertir lso objetos al tipo ts class(AirPassengers) ## [1] "ts" autoplot(AirPassengers) + theme_classic() Podemos también gráficar multiples series de tiempo autoplot(arrivals) + theme_classic() autoplot(arrivals, facet =TRUE) + theme_classic() + geom_smo...
2368 sym R (2385 sym/38 pcs) 20 img
Introduction to forecasting
library("forecast") ## Registered S3 method overwritten by 'quantmod': ## method from ## as.zoo.data.frame zoo library("fpp2") ## Loading required package: ggplot2 ## Loading required package: fma ## Loading required package: expsmooth Métodos de pronóstico naive Un pronóstico naive es simplemente el valor observado mpas reci...
3672 sym R (6043 sym/31 pcs) 3 img
Experimental Design
The experiment involves collecting data with the question in mind and will include analyzing the data to seek the answer Steps of an experiment Planning Dependent variable = outcome Independent variables(s) = explanatory variables Design Analysis Key components of an experiment Randomization: Evenly distributes any variability in outcome d...
4068 sym R (12304 sym/56 pcs) 3 img
Object Oriented programming in R
Nine systems for OOP in R OOP S4 ReferenceClasses R.oo R5 proto mutatr S3 R6 S3 system It was introduced in the third version of the S language that was precursor of R. Strongly recommended. S4 System It was introduced in the fourth version of the S language that was precursor of R. Use for bioconductor ReferenceClass Are an attempt to create...
6175 sym R (19053 sym/78 pcs)
A/B testing
AB testing is a powerful way to try out a new design or program changes before making final decisions AB testing is a framework for you to test different ideas for how to improve upon an existing design, often a website You want to be contantly updating your website or app to maximize thing like conversion rate or usage time AB testing case Qu...
3451 sym R (6029 sym/46 pcs) 2 img