Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
MSS PS: Introduction to R
#MSS PS: Introduction to R! # this is the code wall editor (not live), you'll have to edit along with me- #you may need to click "Run it" in the bottom left corner to see the output & pretty graphs! #let's make up some data! set.seed(42) mydata<-rnorm(1:100, mean=50, sd=10) mydata_shifted<-mydata+20 mydata2<-rnorm(1:100, mean=50, sd=10) mydata_shifted_random<-mydata+sample(15:30, 100, replace=TRUE) randomdata<-sample(1:100, 100, replace=TRUE) #Descriptives #what is the mean of the data? #mean(mydata) #what is the standard deviation of the data? #sd(mydata) #what are the z scores of the data? #mydata_zscored<-scale(mydata) #Plotting #histogram/bar chart #hist(mydata) #box plots of the mydata and mydata_shifted #boxplot(mydata, mydata_shifted) #density plots of mydata (smoothed histogram) #plot(density(mydata)) #lines(density(mydata2), col="red") #density plot of shifted data #plot(density(mydata)) #lines(density(mydata_shifted), col="green") #desnity plot of randomly shifted data #plot(density(mydata)) #lines(density(mydata_shifted_random), col="orange") #Inferential Analyses #t test, paired, assuming equal variances #t.test(mydata, mydata_shifted_random, paired=TRUE, var.equal=FALSE) #ANOVA ("Analysis of Variance") test of mydata and mydata_shifted_random #aov(mydata~mydata_shifted_random) #plot of my data vs mydata_shifted_random #plot(mydata, mydata_shifted_random) #draw the line of best fit from the linear model/random #lines((c(0:100)*beta-intercept),c(0:100), col="purple") #Non-inferential Analyses #correlation between mydata & mydata_shifted_random #cor(mydata,mydata_shifted_random)
run
|
edit
|
history
|
help
0
Monroe Week 9 Homework
CRR convergence
Basic Programming
10-08-2020CalcuNum
3dgraphics-and-curvesb
QRdecomposição
Call option formula for Geometric Laplace distributed stock
SimulacaoItaly-17-02-2021
SampleDiscrFR.r
Mann Whitney wilcoxon test