Applied Methods in Statistics
Practical Information
Getting Started
Exercise 1: Create New Project
Exercise 2: Importing data in R
Import
txt
or
csv
Import Microsoft Excel spreadsheet
Load
rdata
,
rda
or
rds
Reading data from clipboard (“pasting” copied data into an R object)
Exercise 3: Exporting data to a file
Exercise 4: Data Structure in R
Vector
Matrix
Array
List
Data Frame
Exercise 5: Exploring the data
Structure of an R-object
Accessing elements from R-objects
View Data in RStudio
Summary of data
Dimension of data
Lets Practice
Exercise 6: Subsets of data and logical operators
Logical vector and index vector
Subsetting data frame
Exercise
Exercise 7: Graphics
Spice up the plot
Regression Analysis
Least Squares App
Dataset: birth
Overview of data
Linear Regression
Regression with categories
Dataset: bodydata
Training Samples
Fitting Model
Understanding the fitted Model
Multiple Linear Regression and Prediction
Extra on R-squared
Dataset: mtcars
Ex-1: Model Fitting
Ex-2: Indicator variable
Ex-3: Comparing models - Partial F-test
Ex-4: Influential measurements
Ex-5: Model selection
Ex-6: Model validation
Analysis of variance
Chlorine levels in cities
Data from the NSR education test
Barley Data
Multivariate Analysis (PCA)
Track and Field data
Multivariate Analysis (PCR, PLS)
Prediction of cow milk percentage
Discrimination and classification
Iris Dataset
Generalized Linear Model
Species Data
Taxonomy Data
Random Effect Model
Litter sizes
Mixed Effect Model
Exercises and Diet
Exam Questions
Exam 2016
Exercise 1
Exersise 2
Exercise 3
Exam 2017
Exercise 1
Exercise 2
Exercise 3
Exercise 4
Appendix to exam STAT340
Lecturer:
Thore Egeland
Assistent Teachers:
Kathrine Frey Frøslie
Applied Methods in Statistics
Mixed Effect Model
library
(car)
library
(nlme)
load
(
'_data/exer.rdata'
)