Publications by Shariq Mian
Discussion week 12
# Load the mtcars dataset data(mtcars) # Add the required terms to the dataset mtcars$x1_squared <- mtcars$mpg^2 # Quadratic term mtcars$dichotomous <- as.factor(ifelse(mtcars$cyl > median(mtcars$cyl), 1, 0)) # Dichotomous term mtcars$x2 <- rnorm(nrow(mtcars)) # Quantitative variable for interaction # Build a multiple regression model m...
1442 sym
Document
Question 1 A bag contains 5 green and 7 red jellybeans. How many ways can 5 jellybeans be withdrawn from the bag so that the number of green ones withdrawn will be less than 2? Q1=choose(5,1)*choose(7,4)+choose(5,0)*choose(7,5) Q1 #5C1∗7C4+5C0∗7C5=196 ## [1] 196 Question A certain congressional committee consists of 14 senators and 13 repr...
2485 sym
Data605_HW5
Q1 A new test for multinucleoside-resistant (MNR) human immunodeficiency virus type 1 (HIV-1) variants was recently developed. The test maintains 96% sensitivity, meaning that, for those with the disease, it will correctly report “positive” for 96% of them. The test is also 98% specific, meaning that, for those without the disease, 98% will...
2719 sym
Data605_HW9
page 363 11 The price of one share of stock in the Pilsdorff Beer Company (see Exercise 8.2.12) is given by Yn on the nth day of the year. Finn observes that the differences Xn = Yn+1 − Yn appear to be independent random variables with a common distribution having mean µ = 0 and variance σ2 = 1/4. If Y1 = 100, estimate the probability that ...
1274 sym
Data605_HW13
Calculus with R 1. Use integration by substitution to solve the integral below. u=−7xdu=−7dx ∫4e−7xdx ∫−47eudu ∫−47eudu −47∫eudu −47eu+C −47e−7x+C Biologists are treating a pond contaminated with bacteria. The level of contamination is changing at a rate of dNdt=−3150t4−220 bacteria per cubic centimeter per day, w...
2026 sym
Data605_HW12
url <- 'https://github.com/mianshariq/SPS/raw/15791aaf54198f05264e55d1bce0efba5ef550b1/Data%20605/who.csv' who <- read.csv(url) head(who) ## Country LifeExp InfantSurvival Under5Survival TBFree PropMD ## 1 Afghanistan 42 0.835 0.743 0.99769 0.000228841 ## 2 Albania 71 ...
3469 sym 2 img
Data605_HW10
If Smith is in state 0, he will always stay in state 0 (0 -> 0). If Smith is in state L, he will always stay in state L (L -> L). If Smith is in any state from 1 to 7, he has a 40% chance of winning and moving to the next state with a higher fortune, and a 60% chance of losing and moving to the previous state with a lower fortune (i.e., i -> i...
813 sym R (1190 sym/4 pcs)
Data605_HW11
head(cars) ## speed dist ## 1 4 2 ## 2 4 10 ## 3 7 4 ## 4 7 22 ## 5 8 16 ## 6 9 10 Plot Data In this linear model, speed is the independent variable and stopping distance is the dependent variable. The plot shows that stopping distance increases as speed increases. plot(cars, xlab = "Speed", ylab = "S...
1639 sym 4 img
Data605_HW1
library(tidyverse) ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.2 ✔ readr 2.1.4 ## ✔ forcats 1.0.0 ✔ stringr 1.5.0 ## ✔ ggplot2 3.4.2 ✔ tibble 3.2.1 ## ✔ lubridate 1.9.2 ✔ tidyr 1.3.0...
9 sym R (2161 sym/4 pcs) 2 img
Data605_Final_Q1
Problem 1 Probability Density 1: X~Gamma. Using R, generate a random variable X that has 10,000 random Gamma pdf values. A Gamma pdf is completely describe by n (a size parameter) and lambda ( , a shape parameter). Choose any n greater 3 and an expected value () between 2 and 10 (you choose). seed_num = 42 set.seed(seed_num) samples = ...
5611 sym