Lecture 1 Flashcards
What are descriptive statistics?
Summary statistics - sum up features of a data sample.
Descriptive statistics (PLURAL) is the process of analyzing those statistics.
What is exploratory data analysis?
The critical process of performing investigations on data to:
discover patterns
spot anomalies
test hypothesis AND
check assumptions
with the help of summary statistics and graphical representations.
Discrete VS Continuous Probability Distributions
DISCRETE: Data can only take on certain values, for example, integers.
CONTINUOUS: Data can take on any value within a specified range (which may be infinite).
For a discrete distribution, probabilities can be assigned to the values in the distribution - for example, the probability that a web page will have 12 clicks in an hour is 0.15.
In contrast, in a continuous distribution, the probability associated with any particular value is null. Therefore, continuous distributions are normally described in terms of probability density, which can be converted into the probability that a value will fall within a certain range.
Console window
Where you type R commands
Source file
Instead of entering commands one at a time in the Console window, you can run a set of commands from a source file.
q()
To quit R
You can perform mathematical calculations in R.
Answers will appear in Console window.
Generating and Displaying an object
Generate: x=5
Display: x
ls()
To list objects available in the current R session
e.g.
x=5
x2=9
COMMAND: ls(pattern=”x”)
CONSOLE: “x” “x2”
NOTE: Pattern - Optional. Only names matching pattern are returned.
exists(“name of object”)
Checks whether or not specified object exists. Returns TRUE or FALSE.
e.g.
COMMAND: exists(“x”)
CONSOLE: TRUE
rm(“name of object”)
Removes previously defined object from the workspace
e.g.
rm(“x”)
Workspace
Objects that you create during an R session are held in memory.
The collection of objects that you currently have is called the workspace. The workspace can be found in the Environment tab.
REMEMBER: The workspace is not saved unless you tell R to save it. This means that your objects are lost when you close R without saving the objects OR when R/your system crashes during a session.
When you close the R-GUI or the R console window, the system will ask you if you want to save the workspace image. If you select the ‘save the workspace image’ option, all the objects in your current R session will be saved in a file (.RData).
getwd()
To find out what the current working directory is
save.image()
To save to the current working directory
save.image(“Working Directory”)
To save to a specific file/location