Beruflich Dokumente
Kultur Dokumente
Summary()
Mean,Median,Mode,Variance,sd
Scale()
• Sort():-by default ascending order,we can
change to descending order
Rank()
Rowsums(),Colsums()
• Table():- It is used for converting in to
contingency table and we need nominal
variable for this
• Spearman Correlation:-
Types of Graphs
Bar Graph. For Qualitative Variables
Pie chart. (nominal /Ordinal)
For Quantitative
Line Graph Variables (interval/ratio)
Histogram.
Leaf and Stem Plot.
Box Plot.
Scatter Plot
Bar diagram
• Bar diagram is the graphical representation of a
nominal/ordinal variable.
• Three types of bar diagrams: simple, subdivided,
stacked
• First we have draw the frequency table
• Then convert that table in to barplot
R syntax for bar diagram
>barplot(table(chickwts$feed)) # simple bar plot
>barplot(table(var1,var2))#subdivided bar plot
>barplot(table(var1,var2),beside=T)# stacked bar plot
Pie chart
• Pie chart is useful to show the relative
importance various categories of a nominal
variable.
• To draw the pie plot first we need to generate
the frequency table and on top of which the
pie chart is drawn.
R syntax for Pie chart
>pie(table(chickwts$feed))
Line Graph
• Used to track trends and patterns in time
series data.
• We can draw line graph for one or more
variables
R code for univariate line graph
>plot(trees$Height, type=‘ l ‘ )
R code for mutivariate line graph
> matplot(trees,type = ‘ l ‘ )
Histogram
• Common graphical presentation of quantitative
data is a histogram.
• The variable of interest is placed on the
horizontal axis.
• A rectangle is drawn above each class interval
with its height corresponding to the interval’s
frequency, relative frequency, or percent
frequency.
R code for histogram
>hist(trees$Volume)
3.Scatter Diagram
• A scatter diagram is a graphical tool for
analyzing correlation between two variables.