Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 4 out of 24 pages
Summary

Summary powerpoint slides practicals data mining

Document preview thumbnail
Preview 4 out of 24 pages

This is a summary of the given powerpoint slides during the practicals. It contains information of the slides including my own notes.

Content preview

Table of Contents

Summary practical PPT data mining .............................................................................................. 3

Practical 1: Data import/export, data types and manipulation......................................................... 3
1. Introduction to R ..................................................................................................................... 3
1.1. A typical R-command ...................................................................................................... 3
1.2. R-studio .......................................................................................................................... 3
2. Data import, export and manipulation ...................................................................................... 4
2.1. Importing and exporting data ........................................................................................... 4
2.2. Types of data ................................................................................................................... 4
2.3. Indexing and selection ..................................................................................................... 5
3. Plotting in R ............................................................................................................................. 6

Practical 2: Statistical analysis is R ............................................................................................... 7
1. Independent sample t-test....................................................................................................... 7
2. Parametric testing and normality.............................................................................................. 7
2.1. Are my data normal enough? ............................................................................................ 7
2.2. Formal test of normality ................................................................................................... 7
3. Simple linear regression .......................................................................................................... 8
3.1. Numeric linear regression ................................................................................................ 8
3.2. Analysis in R .................................................................................................................... 9
4. Analysis of variance ................................................................................................................ 9
4.1. Dummy coding ................................................................................................................ 9
4.2. ANOVA model ................................................................................................................. 9
4.3. Dummy variable ............................................................................................................ 10
4.4. Interpretation of coeLicients .......................................................................................... 10
4.5. Inference in ANOVA ....................................................................................................... 10
4.6. Analysis in R .................................................................................................................. 10

Practical 3: Automation, add-on packages and reshaping .............................................................. 11
1. Automation of repetitive analyses ...........................................................................................11
1.1. Repetitive analysis......................................................................................................... 11
1.2. For-loop ........................................................................................................................ 11
1.3. Automation with new function........................................................................................ 12
1.4. Combine list and for-loop .............................................................................................. 13
2. Add-on packages ...................................................................................................................13
2.1. Base package ................................................................................................................ 13
2.2. Package installation ...................................................................................................... 13
2.3. Activate a package......................................................................................................... 14
3. Reshaping data ......................................................................................................................14
3.1. Data reshaping .............................................................................................................. 14
3.2. Aggregation ................................................................................................................... 14

Principal 4: component analysis and cluster analysis.................................................................... 15
1. Principal Components analysis ..............................................................................................15
1.1. Multidimensional data ................................................................................................... 15
1.2. Principal Component analysis........................................................................................ 15




1

, 2. Cluster analysis .....................................................................................................................16

Practical 5: Multiple linear regression and linear mixed models ..................................................... 17
1. Multiple linear regression........................................................................................................17
1.1. Example 1 ..................................................................................................................... 17
1.2. Categorical covariates ................................................................................................... 17
1.3. Inference on ANCOVA model ......................................................................................... 17
1.4. Main eLects vs interactions ........................................................................................... 18
1.5. Modelling interactions ................................................................................................... 18
1.6. ANCOVA with interaction ............................................................................................... 18
1.7. Graphical interpretation ................................................................................................. 18
1.8. Stepwise backward model building ................................................................................ 19
1.9. Stepwise model building ................................................................................................ 19
1.10. Analysis in R .............................................................................................................. 19
1.11. Further ..................................................................................................................... 20
2. Linear mixed models for analysis of non-independent data ......................................................20
2.1. Non-independent data................................................................................................... 20
2.2. Examples ...................................................................................................................... 20
2.3. Analysis clustered data .................................................................................................. 21
2.4. Clustered data .............................................................................................................. 21
2.5. Linear mixed model ....................................................................................................... 23
2.6. Intraclass coeLicient (ICC)............................................................................................. 23
2.7. More advanced linear mixed models .............................................................................. 23
2.8. Linear mixed models in R ............................................................................................... 24




2

, Summary practical PPT data mining

Practical 1: Data import/export, data types and
manipulation
1. Introduction to R
1.1. A typical R-command




- Seq = sequency
o A func1on that generates a sequence of numbers à a vector
- Vector = one dimensional matrix (column or row)


1.2. R-studio
- Script: add commands, save for later use
- Prompt: here you can directly type in commands at the
prompt. Easy for a quick check or calcula1on that you
don’t want to include into the code
- Work space: all objects that are stored in the R memory
- Various: here you can find your graphs but also some
more explana1on
o If you type ‘?seq’ in prompt, you see the
explana1on in various
- Assignments
o Getwd(): to get your current WD
o Setwd(“C:\temp\...”): change WD
o List.files(getwd()): shows files in current WD
o Read.table(“myInput.txt”)
o Write.table(“myOutput.txt”)




3

, 2. Data import, export and manipulation
2.1. Impor7ng and expor7ng data
- Read-in func1on
o Read.table(file, header = FALSE, sep = "", quote = "\"'", dec = ".", row.names,
col.names, as.is = !stringsAsFactors, na.strings = "NA", colClasses = NA, nrows = -1,
skip = 0, check.names = TRUE, fill = !blank.lines.skip, strip.white = FALSE,
blank.lines.skip = TRUE, comment.char = "#", allowEscapes = FALSE, flush = FALSE,
stringsAsFactors = default.stringsAsFactors(), encoding = "unknown")
§ File = name of the file
§ Header = is there a first line containing the names of the variables. R tells we
need to supply a logical (means you need to tell true or false)
§ Sep = field separater, which character is used to separate the columns
§ Dec = character used for decimal points, the default seeng in R is “.”. If your
file has “.”, you don’t need to supply this argument
§ Na.string = missing value indicator, default is NA, of missing value is NA, you
don’t need this argument, but if it is “?” you need this
§ StringsAsFactors = TRUE if variables are read in as factors
- Things to avoid
o Header line
§ ‘special’ characters in headers (# - &%$?@;-)
§ Columns not having header
o Cells with formula
§ Copy, PasteSpecial, Values
o Empty cells
- Expor1ng a dataset
o Write.table(x, file = "", append = FALSE, quote = TRUE, sep = " ", eol = "\n", na = "NA",
dec = ".", row.names = TRUE, col.names = TRUE, qmethod = c("escape", "double"))
§ Quote = TRUE if a set is true, factors will be surrounded by “” à don’t want
that so quote = FALSE
§ Sep = the field separator, we don’t want white space, we want a tap à
sep=”/t”
§ Row.names = TRUE: a logical that indicate whether the row names of the
data frame are to be wrinen along with x, this means that the row names are
exported with the rest of the table


2.2. Types of data
- 4 main types (or classes) of variables
o Numeric: integer or floa1ng point
o Character: text string
o Factor: categorical variable with limited number of levels, Ordered or not
o Logical: TRUE or FALSE
- Convert data types - coercion
o as.numeric()
o as.character()
o as.logical()
o as.factor()
- Func1ons can operate differently according to data type
o ANOVA vs. regression



4

Table of contents

  1. 01 Summary practical PPT data mining 3
  2. 02 Practical 1: Data import/export, data types and manipulation 3
  3. 03 Introduction to R 3
    1. A typical R-command 3
    2. R-studio 3
  4. 04 Data import, export and manipulation 4
    1. Importing and exporting data 4
    2. Types of data 4
    3. Indexing and selection 5
  5. 05 Plotting in R 6
  6. 06 Practical 2: Statistical analysis is R 7
  7. 07 Independent sample t-test 7
  8. 08 Parametric testing and normality 7
    1. Are my data normal enough? 7
    2. Formal test of normality 7
  9. 09 Simple linear regression 8
    1. Numeric linear regression 8
    2. Analysis in R 9
  10. 10 Analysis of variance 9
    1. Dummy coding 9
    2. ANOVA model 9
    3. Dummy variable 10
    4. Interpretation of coeLicients 10
    5. Inference in ANOVA 10
    6. Analysis in R 10
  11. 11 Practical 3: Automation, add-on packages and reshaping 11
  12. 12 Automation of repetitive analyses 11
    1. Repetitive analysis 11
    2. For-loop 11
    3. Automation with new function 12
    4. Combine list and for-loop 13
  13. 13 Add-on packages 13
    1. Base package 13
    2. Package installation 13
    3. Activate a package 14
  14. 14 Reshaping data 14
    1. Data reshaping 14
    2. Aggregation 14
  15. 15 Principal 4: component analysis and cluster analysis 15
  16. 16 Principal Components analysis 15
    1. Multidimensional data 15
    2. Principal Component analysis 15
  17. 17 Cluster analysis 16
  18. 18 Practical 5: Multiple linear regression and linear mixed models 17
  19. 19 Multiple linear regression 17
    1. Example 1 17
    2. Categorical covariates 17
    3. Inference on ANCOVA model 17
    4. Main eLects vs interactions 18
    5. Modelling interactions 18
    6. ANCOVA with interaction 18
    7. Graphical interpretation 18
    8. Stepwise backward model building 19
    9. Stepwise model building 19
    10. Analysis in R 19
    11. Further 20
  20. 20 Linear mixed models for analysis of non-independent data 20
    1. Non-independent data 20
    2. Examples 20
    3. Analysis clustered data 21
    4. Clustered data 21
    5. Linear mixed model 23
    6. Intraclass coeLicient (ICC) 23
    7. More advanced linear mixed models 23
    8. Linear mixed models in R 24
  21. 21 o Write.table(“myOutput.txt”) 4
  22. 22 o ANOVA vs. regression 5
  23. 23 ð Two-dimensional example 6
  24. 24 Dev.off() 7
  25. 25 Carry out test in separate groups 8
  26. 26 Es1mate b from data using least square method 9
  27. 27 Fined model 1

Document information

Study
Uploaded on
May 29, 2025
Number of pages
24
Written in
2024/2025
Type
Summary
$5.34

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
WillemsenAmber
4.0
(1)
Sold
27
Followers
0
Items
48
Last sold
3 weeks ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions