Question
What are some key R Programming terms? 1.) c( ) 2.) matrix ( ) 3.) str ( ) colnames/type/levels if factor 4.) class ( )
What are some key R Programming terms?
1.) c( )
2.) matrix ( )
3.) str ( ) colnames/type/levels if factor
4.) class ( )
5.) factor ( )
6.) levels ( )
7.) setwd ( )
8.) glass [glass$Type = = 1, ]
9.) length ( )
sample size
10.) Indexing using [ ]
11.) data
col1
col2
col3
12.) data[data$col1 1,]
13.) dbinom P(X=x)
14.) pbinom P(X <= x)
15.) qbinom P(X < k) = #
16.) rbinom
17.) bnom
18.) norm
19.) gamma
20.) t
21.) qqnorm ( )
22.) abline ( )
23.) hist ( )
24.) boxplot ( )
a. ex. Group by things boxplot (number values ~ glass$Type)
25.) par(mfrow = c( ,))
26.) is.na ( ) *important*
27.) for ( ) *Important one*
28.) print ( )
29.) ?? log
30.) ?? histogram
31.) Read.csv *important one*
WEVE SEEN ALL THESE QUESTIONS BEFORE
Question 1: 2 Parts (Worksheet 3)
Question 2: 1 Part (Bonus)
Question 3: 1 Part
***Question 4: Work with dataset (Parts a f) (Big one) (If you dont know the parts before, then you cant do the parts later on) (part e = bonus)
Permutations:
4P6: factorial(6) / factorial(6-4) = 360
Combinations: use choose function
13C4: 4 hearts 1 club
choose(13,4) * choose(13,1) / choose(52,5) = 0.003576431
or
combn(52,5)
ncol(x)
[1] 2598960
BINOMIAL FUNCTION:
sum(pbinom(X VALUE 3,SAMPLE 100,PROB 1/100))
Probability for greater(1-pbinom):
P(X >x1)
1 - pbinom(x1, sample, prob)
Probability for less than:
P(X 3).
pbinom(3, sample100, prob 0.05) = 0.2578387
continuous uniform distribution from 1 to 5. Determine the conditional
probability P(X > x1 | X x2)
(punif(x2,1,5) - punif(x1,1,5)) / punif(x2,1,5) = 0.5
Area under curve:
pnorm(x,mean,sd) always gives the area TO THE LEFT of x
to get area to right do 1- pnorm func
z = 1.43.
pnorm(1.43, mean = 0, sd = 1, lower.tail = TRUE) = 0.9236415
between z = x1 and z = x2
pnorm(x2, mean = 0, sd = 1) - pnorm(x1, mean = 0, sd = 1)
value of k such that P(Z < k) = x1.
qnorm(x1, mean = 0, sd = 1, lower.tail = TRUE)
P(x1 < X < x2)
pnorm(x2, mean, sd) - pnorm(x1, mean,sd)
Percentiles:
95th percentile from a Standard Normal Distribution.
qnorm(0.95)
Percentiles with t-distrib:
99th percentile from a t-distribution with n degrees of freedom.
qt(0.99, n)
from x1 to x2 (inclusive)
P(x1 X x2) = P(X x2) P(X < x2-1)
Pbinom
Pt function
lower.tail
logical; if TRUE (default), probabilities are P[X x], otherwise, P[X > x].*
quantile(file name,0.95)
95%
Bla bla
Summary function gives
Min. :
1st Qu.:
Median :
Mean :
3rd Qu.:
Max. :
QQPLOTS:
Turn it into data frame first
df<-data.frame(LatexPaint)
qqnorm(df$CloumnNAme)
qqline(df$Column name,col='red')
BOXPLOT
Boxplot(df, horizontal=T)
Pick specific columns and get their data:
tapply(pollutants$CO, pollutants$NOX, summary)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started