LISAM. Statistical software.

Slides:



Advertisements
Similar presentations
Introduction to R Brody Sandel. Topics Approaching your analysis Basic structure of R Basic programming Plotting Spatial data.
Advertisements

R for Macroecology Aarhus University, Spring 2011.
Introduction to MATLAB The language of Technical Computing.
COMP 116: Introduction to Scientific Programming Lecture 37: Final Review.
Lecture 7 Sept 19, 11 Goals: two-dimensional arrays (continued) matrix operations circuit analysis using Matlab image processing – simple examples Chapter.
Lecture 6 Sept 15, 09 Goals: two-dimensional arrays matrix operations circuit analysis using Matlab image processing – simple examples.
Lecture 2 LISAM. Statistical software.. LISAM What is LISAM? Social network for Creating personal pages Creating courses  Storing course materials (lectures,
Matlab Intro. Outline Matlab introduction Matlab elements Types Variables Matrices.
How to Use the R Programming Language for Statistical Analyses Part I: An Introduction to R Jennifer Urbano Blackford, Ph.D. Department of Psychiatry Kennedy.
Introduction to MATLAB ENGR 1187 MATLAB 1. Programming In The Real World Programming is a powerful tool for solving problems in every day industry settings.
 First time student activates their google account, they need to go to an internet browser and go to  drive.google.com/a/students.macon.k12.nc.usdrive.google.com/a/students.macon.k12.nc.us.
Introduction to MATLAB Session 1 Prepared By: Dina El Kholy Ahmed Dalal Statistics Course – Biomedical Department -year 3.
SAS Workshop Lecture 1 Lecturer: Annie N. Simpson, MSc.
732A44 Programming in R.  Self-studies of the course book  2 Lectures (1 in the beginning, 1 in the end)  Labs (computer). Compulsory submission of.
Data, graphics, and programming in R 28.1, 30.1, Daily:10:00-12:45 & 13:45-16:30 EXCEPT WED 4 th 9:00-11:45 & 12:45-15:30 Teacher: Anna Kuparinen.
REVIEW 2 Exam History of Computers 1. CPU stands for _______________________. a. Counter productive units b. Central processing unit c. Copper.
Introduction to R Part 2. Working Directory The working directory is where you are currently saving data in R. What is the current working directory?
ELG 3120 Signal and System Analysis 1 Introduction to MATLAB TAs Wei Zhang Ozgur Ekici (Section A)(Section B) ELG 3120 Lab Tutorial 1.
Introduction to R Lecture 3: Data Manipulation Andrew Jaffe 9/27/10.
Mary Beth Youse Wilmington University TLT Symposium May 5, 2012 Devise and Deliver - Online Assessments in Blackboard 1.
A Brief Introduction to Matlab Laila Guessous Dept. of Mechanical Engineering Oakland University.
Piotr Wolski Introduction to R. Topics What is R? Sample session How to install R? Minimum you have to know to work in R Data objects in R and how to.
1 Computer Programming (ECGD2102 ) Using MATLAB Instructor: Eng. Eman Al.Swaity Lecture (1): Introduction.
Matlab Basics Tutorial. Vectors Let's start off by creating something simple, like a vector. Enter each element of the vector (separated by a space) between.
What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation tools. Others include Maple Mathematica MathCad.
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
Math 15 Lecture 9 University of California, Merced Scilab A Short Introduction – No. 3 Today – Quiz #4.
Introduction to R Introductions What is R? RStudio Layout Summary Statistics Your First R Graph 17 September 2014 Sherubtse Training.
Lecture 20: Choosing the Right Tool for the Job. What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation.
Lecture 26: Reusable Methods: Enviable Sloth. Creating Function M-files User defined functions are stored as M- files To use them, they must be in the.
STAT 534: Statistical Computing Hari Narayanan
Digital Image Processing Introduction to MATLAB. Background on MATLAB (Definition) MATLAB is a high-performance language for technical computing. The.
Math 252: Math Modeling Eli Goldwyn Introduction to MATLAB.
1 EPIB 698C Lecture 1 Instructor: Raul Cruz-Cano
Lecture 11 Introduction to R and Accessing USGS Data from Web Services Jeffery S. Horsburgh Hydroinformatics Fall 2013 This work was funded by National.
Introduction to R and Data Science Tools in the Microsoft Stack Jamey Johnston.
Review > x[-c(1,4,6)] > Y[1:3,2:8] > island.data fishData$weight[1] > fishData[fishData$weight < 20 & fishData$condition.
16BIT IITR Data Collection Module If you have not already done so, download and install R from download.
Working with data in R 2 Fish 552: Lecture 3. Recommended Reading An Introduction to R (R Development Core Team) –
Introduction to R and Data Science Tools in the Microsoft Stack Jamey Johnston.
Physics 114: Lecture 1 Overview of Class Intro to MATLAB
Web Database Programming Using PHP
Introduction to R and Data Science Tools in the Microsoft Stack
Introduction to R and Data Science Tools in the Microsoft Stack
Programming in R Intro, data and programming structures
Intro to R & MS Data Science Tools
Web Database Programming Using PHP
Matlab Training Session 4: Control, Flow and Functions
L – Modeling and Simulating Social Systems with MATLAB
SAS Programming Introduction to SAS.
Scripts & Functions Scripts and functions are contained in .m-files
INTRODUCTION TO BASIC MATLAB
MATLAB DENC 2533 ECADD LAB 9.
Matlab Workshop 9/22/2018.
ECONOMETRICS ii – spring 2018
Chapter 1: Introduction to SAS
Lab 1 Introductions to R Sean Potter.
MATH 493 Introduction to MATLAB
Use of Mathematics using Technology (Maltlab)
Assignment 4 For this assignment refer to the notes on MATLAB from an MIT course that you can find here (or at the original website, lectures 14, 15, 16).
Web DB Programming: PHP
Matlab Intro.
INTRODUCTION TO MATLAB
Spreadsheets, Modelling & Databases
StudentWeb Orientation
R Course 1st Lecture.
Matlab Training Session 2: Matrix Operations and Relational Operators
Data analysis with R and the tidyverse
Matlab Basics Tutorial
Matlab Intro.
Presentation transcript:

LISAM. Statistical software. Lecture 2 Course leader: Oleg Sysoev 732A60

LISAM What is LISAM? Social network for Creating personal pages Creating courses Storing course materials (lectures, documents, useful links) Publishing assignments to certain student groups (labs, project work) Uploading and submitting solutions to assignments electronically Correcting and grading the solutions Communication between students and teacher http://lisam.liu.se 732A60

How it looks like when you logon 732A60

Panels Menu Newsfeed: you find comments from people and courses you have chosen to follow Important menus: About me (edit the profile, set the default language) Courses and Programmes: See all courses that you registered yourself for. LISAM support help information 732A60

If the webpage is in Swedish About meUpdate profile 732A60

Accessing a course My courses 732A60

Course structure 732A60

Course structure Syllabus: compressed information about the course, teaching, examination and admission requirements Course documents: basic course material: lectures, files (uploaded by teacher) Collaborative workspace: teachers and students can publish files there and make comments Newsfeed: Teachers and students may start a conversation there Announcements: information from teacher Timetable: link to schedule in TimeEdit Submissions: Here you may find your labs/assignments and submit the answer Assessment record: The overview of your grades 732A60

Course menus Note that each lab/assignment has a deadline and an end date 732A60

Submit a report 732A60

Statistical, DM and ML software Commerical SAS Minitab SPSS Matlab Microsoft SQL Server Free of charge: R WinBugs, JAGS Python Apache Spark 732A60

SAS SAS SAS Base SAS Enterprise Guide SAS JMP … 732A60

SAS How SAS is started What is Library Learn: How SAS is started What is Library What's in the Editor, Output, Log What's in the Results How to create a library How to import XLS document to the library Note data material (Column attributes) Write a simple computer program and save the file proc. gplot data = sashelp.class; plot height * weight; run; Run the program Sas file upload. Help (contents, index, search, SAS/GRAPH, SAS/STAT) 732A60

R R is a computer language with full flexibility Constantly increasing amount of packages (new research) Free of charge Website: http://www.r-project.org/ Code Editor: http://rstudio.org/ 732A60

Software: use RStudio Install R: http://www.r-project.org/ Install RStudio: http://rstudio.org/ Workspace Program Plots Execution console 732A60

Basics in RStudio Important to know: Create a new file and save it (File menu) Running one line or entire code (Edit menu) Running one line in console Workspace (Observe, Save, Clear) Setting current directory (Tools) Installing new package (Packages tabs) 732A60

Call help Specific function Help browser Search for something in help help(function) Help browser help.start() Search for something in help help.search(“expression”) Quick reminder of function arguments: args(function) Examples of how to use function: example(function) If some method is not installed on the computer: RSiteSearch(”expression") 732A60

Introduction R is case-sensitive (A and a) Each command on a new line or use ; Comment: #R is a very cool language! Initialize/set the variable Use-> or <- or = a<-3 3->b 732A60

Vectors Create a vector x<-c(1,3) See the result x print(x) 732A60

Operation with vectors indexing Element-wise: +-*/^ log exp sin cos length –number of elements sum - sum of all elements max min sort order which.min which.max Logicals: TRUE or FALSE: A=TRUE; > >= < <= != & (and) | (or) 732A60

Matrices Use matrix() a<-matrix(values,nrow=m,ncol=n) Values should be listed columnvise nrow= and ncol= can be skipped Create empty matrix 732A60

Matrix operations Usual vector operations can also be applied: 732A60

Matrix operations Matrix operators/functions: transpose b=t(a) b = aT Inverse b = a-1 b=solve(a) Solve d=a-1b d=solve(a,b) 732A60

Indexing for matrices Positive index x[1,6] x[2:10,] Negative index x[2,-(1:5)] row 2 and all columns except 1:5 Entire column or row y=x[2,] entire row 2 Extraction x[x>5] 732A60

Replication Replication for vectors Replication for matrices rep(what, times) Replication for matrices matrix() 732A60

Matrix operations Dimension Row/column stististics dim(mat) Row/column stististics colMeans, rowMeans, colSums,rowSums Apply a function over vector/matrix Sapply() Normally used when function works only element-wise 732A60

Vector/matrix operations Create confusion matrix (classification) table(X,Y) Extract diagonal Diag(X) 732A60

Factors Text values 732A60

Lists List is a collection of objects 732A60

Data frame Vectors and matrices of the row length can be collected into a data frame Used to store the data of different types into a single table Use data.frame(object 1, object 2, … , object k) 732A60

Data frame Any column in the data frame can be retrieved by dataframe$object Any row in the data frame can be extracted by using matrix notation, for ex: z[1,] 732A60

Read data from Excel file Save as ”comma-separated file”(csv) Change current directory, Session Set Working Directory or setwd() Use Dataframe=read.csv2(file_name) Dataframe=read.csv(file_name) 732A60

Conversion between types Data frame to matrix Matrix to data frame Numeric to factor Factor to numeric List to vector Vector to list 732A60

Conditioning and loops If (x==3) { … } else { } for (i in 2:99) { while(x!=29) { 732A60

Loops for (name in expr1 ) { … } while (condition) 732A60 Introductory course "Statistics & Data Mining" 2012

Using a function Use ?name_of_function to see function parameters For ex. ?lm There are some obligatory parameters and optional parameters The optional parameters can be specified in different order X=1:10 Y=1:10+rnorm(10) W=c(rep(1,5), rep(2,5)) mydata=data.frame(X,Y) result=lm(Y~X, weights=W,data=mydata) ?predict.lm Fit=predict(result) plot(X,Y) points(X,Fit, type="l", col="blue") 732A60

Writing your own functions Function writing must always end with writing the value which should be returned! You may also use ”return(value)” to show what value the function should return 732A60