CHemometrics test 1 Flashcards
What is a barplot
displays distribution of categorical variable - horizontall or vertically
How to simply make a barplot
barplot(data)
can include main , xlab and ylab for titles
data should be grouped under categorical variables (and can select that for the data eg
data$categorical)
Stacked vs grouped barplot and how to program
depends on if your data is matrix rather than a vector - can switch variabesl besides to true or false
What are error bars on bar graphs
typically the height Plus or - stde
What is ggplot? and how to use
an easier way to graph
ggplot(data, aes(x = , y = ) geom_point()
So typically have your gg plot function with your data x and y and then other functions after like geompoint, geom smooth etc
How to make error bars in ggplot
geom_errorbar()
What is jitter
Shows all poitns and adds random spacing to make it easy to visualize
What is a spinogram
a stacked bar plot but scaled to 1 (displays everything in %age
What is a box plot
box and whisker - displays median, upper and lower quartile (edge of box) and the upper and lower hinge (whisker
What is a parallel boxplot
multiple boxplots displayed side by side - can use to see separation of groups
What is a notched boxplot
Box plot with a notch - the notch is a narrowing of box around median - WIDTH is proportional to interqartile range and inverse proportional to size of sample
The notch is the confidence interval around the mean - if two boxes notches DONT overlap - strong evidence that their medians differ
What is a VIOLIN plot and how plot
llibrary(vioplot)
KERNAL density plots superimposed in a mirror image over the box plot(box plot on the inside with black and white lines)
Whats a histogram and how to plot
dispays distributoin of continuous variables (divide range into bins) (hist(data)
What can you put in addition to histogram
can do probability density curve or fit normal curve to it
What is a kernel density plot
estimation of probabiltiy density over variable
Dot plot
Dots (catergorical on one axis continuous on other
Scatter plots
scatter (continuous on both
What are grouping and faceting
faceting displays groups of observations in seperate side by side plots; Grouping displays two or more groups of observations in a single plot
Descriptive vs inferential stats
descriptive describes the stats (eg whats the mean, mode, stdev etc
inferential says something about the data - draws inferences about it (eg these two pop significantly different in regard to this
5 types of descriptive stats
Frequency (how often), central tendency (mean), dispersion (stdev), position (relative position eg quartiles), Shape of observation (skewness and kurtosis)
What are DOF and how determined
DOF = measure of # of independant data pieces used to eval (n- #) - # is number of parameters estimated form data
Talk about skewness and kurtosis
skewness is measure of degree of asymmetry,, 0 if symmetrical
Kurtosis is measure peakedness - 3 is normal , if high very peak , if negative its flat
TWO important notes about inferential stats
assumes each replication in a condition is assumed to be independent
Large sample size - more likely statistic to indicate differences exist
Steps for sig testing (7)
1 state null hypo
2 State alt hypo
3 check if dist normal
4 select appropriate test
5 choose level of significance and number of tails
6 calc statistical value
7 Obtain critical factor for test and compare crit value with test statistic