Publications by Don Padmaperuma
DATA 606 - Lab 7
Batter up The movie Moneyball focuses on the “quest for the secret of success in baseball”. It follows a low-budget team, the Oakland Athletics, who believed that underused statistics, such as a player’s ability to get on base, betterpredict the ability to score runs than typical statistics like home runs, RBIs (runs batted in), and batting...
10568 sym R (5667 sym/52 pcs) 15 img
Tidyverse Extension
Raw Drug-Use Data Background on the Data I am tidying a fivethirtyeight dataset on drug use Github. I am transforming the columns of drugs (3 to 28) into rows, in order to perform analysis on the different drugs used by different age groups. It is important to note that any column header in the dataset with the word ‘use’ is referring to a p...
2063 sym R (19841 sym/30 pcs) 5 img
DATA 607 Final Project
Data Preparation library(tidyverse) ## -- Attaching packages ---------------------------------------------------------------------------------------------------------------------------------------- tidyverse 1.2.1 -- ## v ggplot2 3.2.1 v purrr 0.3.2 ## v tibble 2.1.3 v dplyr 0.8.3 ## v tidyr 0.8.3 v stringr 1.4.0 ## v readr ...
3490 sym R (34026 sym/67 pcs) 1 img 3 tbl
DATA 606 Homework 9
Baby weights, Part I. (9.1, p. 350) The Child Health and Development Studies investigate a range of topics. One study considered all pregnancies between 1960 and 1967 among women in the Kaiser Foundation Health Plan in the San Francisco East Bay area. Here, we study the relationship between smoking and weight of the baby. The variable smoke is c...
7919 sym R (750 sym/12 pcs) 2 img
DPadmaperuma_Assign1
library(pracma) ## Warning: package 'pracma' was built under R version 3.6.2 1. Problem set 1 (1) Calculate the dot product u.v where u = [0.5;0.5] and v = [3;-4] u <- c(0.5, 0.5) v <- c(3, -4) dot_uv <- dot(u, v) dot_uv ## [1] -0.5 (2) What are the lengths of u and v? Please note that the mathematical notion of the length of a vector is n...
1597 sym R (1191 sym/21 pcs)
DPadmaperuma_Assignment2_PS1
Problem Set 1 (1) Show that \(A^TA\) \(\ne\) \(AA^T\) in general. (Proof and demonstration.) A <- matrix(c(1,1,1,2,0,-1,3,1,-2), nrow=3, byrow=TRUE) AT <- t(A) #Matrix A and its Transpose A; ## [,1] [,2] [,3] ## [1,] 1 1 1 ## [2,] 2 0 -1 ## [3,] 3 1 -2 AT ## [,1] [,2] [,3] ## [1,] 1 2 3 ## [2,]...
514 sym R (1441 sym/20 pcs)
Discussion 9
Chapter 9 Exercise 10. Find the probability that among 10,000 random digits the digit 3 appears not more than 931 times. n<-100000 trials<-rep(NA, n) for(i in 1:n){ temp<-sample(c(0:9),10000, replace=TRUE) count<-length(temp[temp==3]) trials[i]<-count } #histogram hist(trials) pnorm(931, mean=1000, sd=sqrt(10000*1/10*9/10), lower.tail =...
198 sym R (247 sym/3 pcs) 1 img
DATA 605 - Assignment 12
Task: Provide a scatterplot of LifeExp~TotExp, and run simple linear regression. Do not transform the variables. Provide and interpret the F statistics, R^2, standard error,and p-values only. Discuss whether the assumptions of simple linear regression met. Raise life expectancy to the 4.6 power (i.e., LifeExp^4.6). Raise total expenditures to th...
2569 sym R (5422 sym/19 pcs) 3 img
DATA 605 - Final Project
library(kableExtra) Problem 1 Using R, generate a random variable X that has 10,000 random uniform numbers from 1 to N, where N can be any number of your choosing greater than or equal to 6. Then generate a random variable Y that has 10,000 random normal numbers with a mean of (N+1)/2. set.seed(123) N <- 10 X <- runif(10000, min=0...
4326 sym R (27191 sym/75 pcs) 12 img 2 tbl
Data608_Assignment1
library(tidyverse) ## -- Attaching packages ---------------------------------------------------------------------------------------------------- tidyverse 1.2.1 -- ## v ggplot2 3.2.1 v purrr 0.3.2 ## v tibble 2.1.3 v dplyr 0.8.3 ## v tidyr 0.8.3 v stringr 1.4.0 ## v readr 1.3.1 v forcats 0.4.0 ## -- Conflicts ---------...
2231 sym R (32405 sym/29 pcs)