Publications by Kitada Smalley
Tree Algorithms in R (Updated rpart)
This code reflects an update on the code from ISLR, which uses the tree package. Instead this code will focus on using the rpart package. Part 1: Regression Trees We will need several packages for today’s code: #install.packages("ISLR") library(ISLR) ## Warning: package 'ISLR' was built under R version 3.6.2 #install.packages("rpart") library(...
1161 sym R (60841 sym/58 pcs) 12 img
LMT: Matrices and MLR
Step 1: Import the data There data are on restaurant rating in New York City. nyc <- read.csv("http://andrewpbray.github.io/data/nyc.csv") head(nyc) ## Case Restaurant Price Food Decor Service East ## 1 1 Daniella Ristorante 43 22 18 20 0 ## 2 2 Tello's Ristorante 32 20 19 19 0 ## 3 3 ...
483 sym R (6225 sym/16 pcs) 1 img
LMT:NFL
Homework #5: Oxygen oxygen<-read.csv("https://raw.githubusercontent.com/kitadasmalley/sp21_MATH376LMT/main/data/oxygenPurity.csv", header = TRUE) model<-lm(purity~hydro, data=oxygen) summary(model) ## ## Call: ## lm(formula = purity ~ hydro, data = oxygen) ## ## Residuals: ## Min 1Q Median 3Q Max ## -4.6724 -3.2113 -0.0626 ...
254 sym R (3941 sym/35 pcs) 2 img
LMT: ANOVA
For this example we will continue to use the {rocket} data. rocket<-read.csv("https://raw.githubusercontent.com/kitadasmalley/sp21_MATH376LMT/main/data/rocketProp.csv", header=TRUE) colnames(rocket)<-c("obs", "shear", "age") # fitting and store the SLR model mod<-lm(shear~age, rocket) Confidence Interval for \(\sigma^2\) Recall...
971 sym R (1094 sym/23 pcs)
LMT: Class Exercises for W11 and W12
Delivery Data delData<-read.csv("https://raw.githubusercontent.com/kitadasmalley/sp21_MATH376LMT/main/data/deliveryTime.csv", header=TRUE) attach(delData) Class 11A: Create a 3D Scatterplot #install.packages("scatterplot3d") library("scatterplot3d") sp3d<-scatterplot3d(x=numCases, y=distance, z=delTime, ...
624 sym R (7012 sym/38 pcs) 1 img
LMT: Multicollinearity
For this example, we will continue using the Hald data: Hald [1952] presented a dataset concerning the heat involved in calories per gram of cement (𝑌) as a function of the amount of each of the following four ingredients in the mixture: \(x_1\): tricalcium aluminate \(x_2\): tricalcium silicate \(x_3\): tetracalcium alumino ferrite \(x_4\): ...
1483 sym R (4735 sym/30 pcs) 1 img
MATH266: Random Experiments
Simulating Random Experiments with the sample function We can use the sample function simulate tossing a coin. This function takes the arguments: x: either a vector of one or more elements from which to choose, or a positive integer size: a non-negative integer giving the number of items to choose replace: should sampling be with replacement? B...
1847 sym R (554 sym/19 pcs)
DataViz: US Map Demo
Motivating Example: In this demo we will be looking voter turn out data from IPUMS from 2016 and 2018. vote<-read.csv("https://raw.githubusercontent.com/kitadasmalley/DATA502/main/FALL2021/Data/voterTurnOut1618.csv", header=TRUE, stringsAsFactors = FALSE) Step 1: State Polygons Import the shapes using the usmaps pack...
315 sym R (1539 sym/9 pcs) 2 img
FC2021: Food Insecurity
1) Load Food Insecurity Data Cleaned to change NULL to NA: fc<-read.csv("/Users/hsmalley/Downloads/fallFood.csv", head=TRUE, stringsAsFactors = FALSE) #str(fc) 2) Filter for State This filters the data for Oregon and also creates a variable called GEOID to join with spatial data later. GEOID is a code that is used by...
4598 sym R (5585 sym/14 pcs) 1 img
MATH138: Cereal Box Plot Lab
Learning Objectives: Create boxplots to describe distributions of a variable Explore subgroups within the data Use numerical summaries to describe characteristics of the data Step 1: Import your data cereal<-read.csv("https://raw.githubusercontent.com/kitadasmalley/MATH138/main/HAWKES/Data/cerealDat.csv", header=TRUE) How man...
1222 sym R (466 sym/7 pcs)