본문 바로가기
반응형

분류 전체보기123

Ways to draw histogram, adjust the width of boxes/ hist(),ggplot(),qplot() I will make a histogram from data 'airqulity' which is built in the ggplot2 package. histogram is a graphical display of distribution of data which consists of nonoverlapping bins. Generally, y-axis of histograms which is the height of each bin in the histogram is proportional to frequencies of the number of cases of the unit of the variable in x-axis. The graphs below represents the distributio.. 2020. 8. 11.
(R) Ways to make Bar graph (continuous variable --> Discrete variable)/qplot, ggplot,barplot continuous variable _x discrete variable_x > table(mpg$cyl) 4 5 6 8 81 4 79 70 >barplot(table(mpg$cyl)) > ggplot(data=mpg,aes(x=cyl))+geom_bar() > qplot(mpg$cyl,binwidth=0.5) When the variable x is a numeric value, the variable is regarded as continuous variable using ggplot()-geom_bar(),geom_col() and the graph becomes containing the vacant element. (ex) cyl=7 above You can make the variable di.. 2020. 8. 11.
(R) two lines in a graph, lines and points in a graph. > plot(women$height,women$weight,type="l") > ggplot(data=women,aes(x=height,y=weight))+geom_line() > qplot(data=women,height,weight,geom="line") > plot(women$height,women$weight,type="l")> points(women$height,women$weight)> ggplot(data=women,aes(x=height,y=weight))+geom_line()+geom_point()> qplot(data=women,height,weight,geom=c("line","point")) > ggplot(data=women,aes(x=height,y=weight))+geom_li.. 2020. 8. 10.
Chi-Square distribution Chi-Square distribution Chi-Square distribution is a distribution with parameter n which is called 'degree of freedom.'The distribution is closely related to Normal distribution and Gamma distribution. Specifically, it is a critical distribution when it comes to samples and variance of normal distribution. Also, it is a special case of Gamma distribution with specific parameters. The first prope.. 2020. 8. 6.
반응형