[PDF] simpleR – Using R for Introductory Statistics





Previous PDF Next PDF



FL STUDIO - Getting Started Manual

Restart FL Studio – Your name and license code will show at the top of the website and watch hours of cool video tutorials this is really useful



Music Scoring for Film Using Fruity Loops Studio

This study aims to find out how the music scoring process for a film using FL Studio as a reference for making music for films. Keywords: Digital audio 



magazine

top by providing some of the best A mini-review of the new Playlist in FL Studio 9. Hot Topics: Lanes ... m.com



PSoC Creator User Guide

This is the first of a few design tutorials included in this PSoC Creator Help file. The Schematic Editor displays the top-level schematic file ...



FL STUDIO

Restart FL Studio – Your name and license code now appear at the top of the website and watch hours of cool video tutorials this is really useful so.



android-studio-guide.pdf

FIRST® Tech Challenge Android Studio Manual



Cableguys HalfTime Manual

Works with Ableton Live Logic Pro



PSoC Creator User Guide

This is the first of a few design tutorials included in this PSoC Creator Help file. The Schematic Editor displays the top-level schematic file ...



Lex Luger Type Beat Flp Fruity Loops Project 3 *2012* Audio

1954 High Top Twin Strap Baby Booties Crochet Pattern · FL Studio Tutorials: Videos FLP



simpleR – Using R for Introductory Statistics

percentage of the data from the top and the bottom and then take the average. To do this in R we need to tell the mean() how much to trim. > 

simpleR{UsingRforIntroductoryStatistics

JohnVerzani

20000400006000080000120000160000

2e+054e+056e+058e+05

y pagei

Preface

arenottoshowallthefeaturesof illustratethefeaturesof

Thesenoteswerewrittentotakeadvantageof

RCMD

INSTALLpackagename.tar.gz

Rpackagefrom:

0.4.zipforWindowsusers.

0.4.tar.gzforUNIXusers.

Copyrightc

Contents

Introduction1

Whatis

Data1

Starting

Enteringdatawith

Dataisa

UnivariateData8

BivariateData19

MultivariateData32

Manipulatingdataframes:

Using The simpleR{Using

RforIntroductoryStatistics

pageii

RandomData41

Randomnumbergeneratorsin

Simulations47

Using

ExploratoryDataAnalysis54

CondenceIntervalEstimation59

HypothesisTesting66

Two-sampletests68

ChiSquareTests72

RegressionAnalysis77

MultipleLinearRegression84

AnalysisofVariance89

Appendix:InstallingR94

Appendix:ExternalPackages94

Appendix:AsampleRsession94

simpleR{Using

RforIntroductoryStatistics

pageiii

Appendix:WhathappenswhenRstarts?100

Appendix:UsingFunctions100

Appendix:EnteringDatainto

R103 Using using Using

Appendix:TeachingTricks106

Appendix:Sourcesofhelp,documentation107

simpleR{Using

RforIntroductoryStatistics

Datapage1

Section1:Introduction

WhatisR

Ratthisearlylevelwillbetter

\learningcurve".

Thebenetsof

Rforanintroductorystudentare

Rhasanexcellentbuilt-inhelpsystem.

Rhasexcellentgraphingcapabilities.

Whatis

RprojectwasstartedbyRobertGentlemanand

audience.Itiscurrentlymaintainedbythe developers.The

Rprojectwebpage

http://www.r-project.org isthemainsiteforinformationon andothersourcesofdocumentation.

Anoteonnotation

datasetnamesanddierenttypesettingfor longersequencesofRcommands. andfor

Datasets.

Section2:Data

toenterdatainto

Randhowtomanipulatethedataoncethere.

StartingR

simpleR{UsingRforIntroductoryStatistics

Datapage2

the ways.Once

R:Copyright2001,TheRDevelopmentCoreTeam

Version1.4.0(2001-12-19)

Type`contributors()'formoreinformation.

Type`q()'toquitR.

[Previouslysavedworkspacerestored] +isusedforthecontinuationprompt.

Enteringdatawithc

ofthesenotes:

23031001

ToenterthisintoanRsessionwedosowith

>typos=c(2,3,0,3,1,0,0,1) >typos [1]23031001

Noticeafewthings

Weassignedthevaluestoavariablecalled

typos

Thevalueofthe

inputlineindicates thatlater.

Typingless

Applyingafunction

simpleR{Using

RforIntroductoryStatistics

Datapage3

>mean(typos) [1]1.25 >median(typos) [1]1 >var(typos) [1]1.642857

Dataisavector

Oursimpledatavector

setagain. following: >typos.draft1=c(2,3,0,3,1,0,0,1) >typos.draft2=c(0,3,0,3,1,0,0,1)

Rtochangetherst

page?Theanswerofcourseis\yes".Hereishow >typos.draft1=c(2,3,0,3,1,0,0,1) >typos.draft2=typos.draft1#makeacopy commentcharacterisignored(by inthevector typos.draft2 >typos.draft2#printoutthevalue [1]03031001 >typos.draft2[2]#print2ndpages'value [1]3 >typos.draft2[4]#4thpage [1]3 >typos.draft2[-4]#allbutthe4thpage [1]0301001 [1]030 slicing. pages2and4areaproblem.Canwedothiswith

Rinamoresystematicmanner?

simpleR{Using

RforIntroductoryStatistics

Datapage4

>max(typos.draft2)#whatareworstpages? [1]3#3typosperpage >typos.draft2==3#Wherearethey?

The2ndand4thansweryes(

TRUE)theothersno.

Thinkofthisasasking

andFALSE's.

TRUEvalues?Let'srephrase,which

whichwillwork,youareonyourwaytoRmastery: >which(typos.draft2==3) [1]24

Thebasicideaistocreateanewvector

onesforwhich typos.draft2==3: >n=length(typos.draft2)#howmanypages >pages=1:n#howwegetthepagenumbers >pages#pagesissimply1tonumberofpages [1]12345678 [1]24 usefulthingtoknow.Thecommand ifnot.Amoregeneral abovetry seq(a,b,1).

TRUEsand

dataasyoudesire. [1]24

Ryouneedtounderstandhowonecomposes

have >sum(typos.draft2)#Howmanytypos? [1]8 [1]4 [1]20000000

45,43,46,48,51,46,50,47,46,45

>x=c(45,43,46,48,51,46,50,47,46,45) >mean(x)#themean [1]46.7 simpleR{UsingRforIntroductoryStatistics

Datapage5

>median(x)#themedian [1]46 >max(x)#themaximumorlargestvalue [1]51 >min(x)#theminimumvalue [1]43 addthenexttwoweeksworthofdatato x.Thiswas

48,49,51,50,49,41,40,38,35,40

Wecanaddthisseveralways.

>x=c(x,48,49,51,50,49)#appendvaluestox >length(x)#howlongisxnow(itwas10) [1]15 >x[16]=41#addtoaspecifiedindex operatortocombinethepreviousvalueof index.Atthetimeoftheassignment,

RBasics:GraphicalDataEntryInterfaces

students.Hereareexampleswithannotations >x=de(x)#sameonly,doesn'tsavechanges >x=edit(x)#useseditortoeditx. >data.entry(x)#fails.xnotdefined

Errorinde(...,Modes=Modes,Names=Names):

Object"x"notfound

20astheotherdaysdon'thaveenoughdata.

>day=5; >mean(x[day:(day+4)]) [1]48

Thetrickistheslicetakesoutdays5,6,7,8,9

>day:(day+4) [1]56789 andthemeantakesjustthosevaluesofx. max(x).However,youmaybeinterested

Rhadabuilt-infunctionto

handlethis.Itiscalled ofdataalongwiththesimilar cummin: >cummax(x)#runningmaximum >cummin(x)#runningminimum simpleR{UsingRforIntroductoryStatistics

Datapage6

Example:Workingwithmathematics

7412223511129211121113315679

>mean(whale) [1]152.4 >var(whale) [1]5113.378 >std(whale)

Error:couldn'tfindfunction"std"

>sqrt(var(whale)) [1]71.50789 [1]71.50789 that

SD(X)=v

u u t1 n1n X i=1(XiX)2:

Noticethesumisnow

itisdone: >std=function(x)sqrt(var(x)) >std(whale) [1]71.50789 sd()command.Whichgives >sd(whale) [1]71.50789

RBasics:AccessingData

alogicalvector.Suppose xisthedatavector,forexamplex=1:10. howmanyelements? length(x) ithelementx[2](i=2) allbutithelement x[-2](i=2) rstkelements x[1:5](k=5) lastkelements x[(length(x)-5):length(x)](k=5) specicelements. x[c(1,3,5)](First,3rdand5th) allgreaterthansomevalue x[x>3](thevalueis3) biggerthanorlessthansomevalues x[x<-2|x>2] whichindicesarelargestwhich(x==max(x)) simpleR{UsingRforIntroductoryStatistics

Datapage7

Problems

6531165624659086621966499668216714567447

>x=diff(miles) ll-ups,the

17162024221521151722

andthefunction mintondtheminimum. average. commutes) >sum(commutes>=20)

463339374630483249353048

(supposethecarsareallsimilar)

90009500940094001000095001030010200

Use

2.5Trytoguesstheresultsofthese

Supposeweassume

>x=c(1,3,5,7,9) >y=c(2,3,5,7,11,13) 1.x+1 2.y*2

3.length(x)andlength(y)

4.x+y

5.sum(x>5)andsum(x[x>5])

6.sum(x>5|x<3)#read|as'or',&and'and'

7.y[3]

8.y[-3]

simpleR{UsingRforIntroductoryStatistics

UnivariateDatapage8

9.y[x](WhatisNA?)

10. y[y>=7]

2.6Letthedataxbegivenby

>x=c(1,8,2,6,3,8,5,5,5,5)

1.(X1+X2++X10)=10(use

sum)

2.Findlog10(Xi)foreachi.(Usethe

logfunctionwhichbydefaultisbasee) x.(Thisistherange.Youcanusemaxand minorguessabuiltincommand.)

Section3:UnivariateData

dowithit. becontinuous.

Categoricaldata

charts.

Usingtables

variable.

Example:Smokingsurvey

Yes,No,No,Yes,Yes

>x=c("Yes","No","No","Yes","Yes") >table(x) simpleR{UsingRforIntroductoryStatistics

UnivariateDatapage9

x NoYes 23

Factors

occasionallyimportanttoknowas iseasywiththecommand >x=c("Yes","No","No","Yes","Yes") >x#printoutvaluesinxquotesdbs_dbs14.pdfusesText_20
[PDF] top linux commands

[PDF] top linux commands cheat sheet

[PDF] top music markets in us

[PDF] top salesforce certifications

[PDF] top salesforce certifications in demand

[PDF] topic sentence and main idea examples

[PDF] topic sentence checklist

[PDF] topic sentence examples

[PDF] topic sentence exercises

[PDF] topic sentence exercises college

[PDF] topic sentence generator

[PDF] topic sentence lesson

[PDF] topic specific vocabulary for ielts pdf

[PDF] topic supporting and concluding sentences examples

[PDF] topic vs main idea worksheet