Statistics with R Programming Notes | B.Sc. (Computer Science) Semester 1 | Mumbai University | munotes
Official Notes munotes.in
Statistics with R Programming
B.SC. (COMPUTER SCIENCE) · SEMESTER 1
Strictly as per the University of Mumbai NEP syllabus in force for B.Sc. (Computer Science)
For B.Sc. (Computer Science) students of the University of Mumbai and all its affiliated colleges
Open the book ↓munotes.in First Year
Contents
Module I The R language and its environment: expressions, decisions, loops, data structures and strings
- What R Is, and Why Statistics Is Done in It 1
- A Short History of R, and What Open Source Means Here 4
- The Words R Uses: Object, Mode, Class and Attribute 7
- Installing R on Windows, macOS and Linux 10
- The R Environment: Console, Workspace and Working Directory 12
- Getting Help, and Installing Packages 15
- The R Graphical User Interface (R GUI) 18
- RStudio: Installing It and Reading Its Four Panes 21
- Customising RStudio 24
- R Commander: Statistics From a Menu 27
- Working With R Scripts 30
- Data Management in RStudio 33
- Reading Data In and Writing It Out 36
- Expressions: Arithmetic, Relational and Logical Operators 39
- Operator Precedence, and How R Reads an Expression 42
- Assignment, and the Rules for a Name 44
- Numbers, Logicals and the Values NA, NULL, NaN and Inf 47
- Decision Making: if, else and else if 50
- switch(), and the Vectorised ifelse() 52
- Loops: The for Loop 54
- Loops: while, repeat, break and next 57
- Why R Prefers Vectorisation to a Loop 60
- Dates in R 63
- Times, Time Zones and Date Arithmetic 66
- Vectors: The Thing R Is Actually Made Of 69
- Indexing a Vector: Five Ways to Pick Elements 72
- Recycling, Coercion and Vectorised Arithmetic 75
- Matrices: Creating, Naming and Indexing 78
- Matrix Arithmetic and Matrix Algebra 81
- Row and Column Work: apply, rowSums, cbind and rbind 84
- Arrays: Three Dimensions and More 88
- Lists: The Container That Holds Anything 91
- Data Frames: The Table Statistics Works On 94
- Subsetting a Data Frame, and Adding or Dropping a Column 98
- Factors: How R Stores a Category 102
- Sorting, Ordering, Merging and Reshaping a Data Frame 105
- Writing Your Own Function 109
- Arguments, Defaults, and What a Function Returns 112
- Scope: Where R Looks a Name Up 115
- The apply Family: apply, lapply, sapply, tapply and mapply 118
- Character Strings in R 121
- Strings and R Objects 124
- Printing Characters: print, cat and format 127
- sprintf(), and Building a Line of Output 130
- Basic String Manipulations 133
- Changing Case, Trimming and Padding 136
- String Operations: Searching and Replacing 139
- Regular Expressions, From Scratch 142
- Practical Session 1: Setting Up and Your First Script 145
- Practical Session 2: Expressions, Decisions and Loops 148
- Practical Session 3: Vectors, Matrices, Lists and Data Frames 152
- Practical Session 4: Functions, Strings and Dates 156
- Module 1: Viva Questions and Their Answers 160
Module II Statistics in R: summaries, regression, distributions, time series, tables and graphics
- What a Statistic Is: Population, Sample and Summary 164
- The mean() Function 167
- The Median 170
- Standard Deviation and Variance 173
- Other Built-in Statistical Functions 176
- Quantiles, summary() and the Five-Number Summary 179
- Correlation, Covariance and scale() 182
- The Mode, and Why R Has No Function For It 186
- What Regression Analysis Is 189
- The Least Squares Line, Worked by Hand 192
- Linear Regression in R: lm(), Coefficients and Residuals 195
- Reading an lm() Summary 199
- Predicting From a Fitted Model 203
- Multiple Regression 207
- Checking a Regression: Residual Plots and What They Say 211
- The Normal Distribution 215
- dnorm(): The Normal Density 218
- pnorm(): The Normal Cumulative Probability 221
- qnorm(): The Normal Quantile 224
- rnorm(): Random Normal Samples, and set.seed() 227
- The Binomial Distribution 230
- dbinom(): The Exact Binomial Probability 233
- pbinom(): The Cumulative Binomial Probability 236
- qbinom(): The Binomial Quantile 239
- rbinom(): Simulating Binomial Trials 242
- Choosing Which Distribution Function to Call 245
- Time Series Analysis: The ts Object 248
- Trend, Seasonality and Decomposition 252
- Moving Averages and a Simple Forecast 255
- Tabulation: Counting With table() 259
- Contingency Tables: What They Show 262
- Making R Contingency Tables 266
- Making Custom Contingency Tables 270
- Selecting Parts of a Table Object 274
- Converting an Object Into a Table 277
- Testing Table Objects, and the Chi-Squared Test 280
- Complex Tables: Margins, Proportions and ftable 283
- Representing Data Through Cross Tabulation 287
- How an R Plot Is Built: Devices, High-Level and Low-Level 291
- Plots of a Single Variable: Histogram and Density 295
- Plots of a Single Variable: Bar, Pie and Dot Chart 299
- Plots of a Single Variable: Box Plot and Stem-and-Leaf 302
- Plots of Two Variables: The Scatter Plot and Its Line 305
- Plots of Multiple Variables 308
- Special Plots: QQ, Mosaic, Coplot and curve 311
- Labels, Legends, Colours and Layout 315
- Storing Graphics 319
- Practical Session 5: Summary Statistics on a Data Frame 322
- Practical Session 6: Regression, End to End 326
- Practical Session 7: The Distribution Functions 330
- Practical Session 8: Tables and Cross Tabulation 334
- Practical Session 9: Plots and Saving Them 338
- Module 2: Viva Questions and Their Answers 342
The chapters
Every chapter of this book comes with the B.Sc. (Computer Science) Semester 1 notes.
The cover and the contents are free to look through. Buy the notes once to read every chapter of every subject in this semester.
Notes: ₹499 Already bought it? Sign in
Free either way: question papers, the syllabus, and the cover and contents of every book.
The rest of this subject
These notes are cut from the University's printed syllabus. Open the syllabus itself for the same subject.