Time：2022-6-6

# 1. installation and loading of R package

``````install.packages("ggstatsplot")
install. Packages ("rstantools") \
install. Packages ("AFEX") \\
Library (ggstatsplot) \``````

R package get! Next, we will introduce several main functions contained in it one by one.

# 2. ggbetweenstats(): mean comparison among multiple groups

### First, take the mean comparison between multiple groups as an example to verify whether it is really possible to draw a line of code. Next, we will use the iris data set in R.

``````ggbetweenstats(data = iris, x = Species, y = Sepal.Length)
`````` #### however! There is too much information in the above picture. What do they mean? See the following figure: Picture png

# 3. ggwithinstats(): repeat measurement

### If a group is collected at multiple time points, this situation belongs toRepeated measurement design, the above-mentioned mean comparison among multiple groups cannot be used because the principle of independence has been violated. In this case, the diagram can be drawn as follows:

``````ggwithinstats(data = iris, x = Species, y = Sepal.Length)
`````` picture

# 4. ggscatterstats(): scatter diagram

#### When studying two continuous variables, the scatter diagram can show the relationship between them. The following is one line:

``````ggscatterstats(data = iris, x = Sepal.Length, y = Sepal.Width)
`````` picture

# 5. gghistostats(): histogram

#### IfI have a continuous variable, and I want to observe its distribution, and whether it is different from a specific value through a single sample t-test, you can do this:

``````gghistostats(data = iris, x = Sepal.Length, test.value = 6)
`````` image.gif

# 6. ggcorrmat(): correlation diagram of multiple variables

#### For a whilePresents the relationship of multiple continuous variables, you can select the correlation matrix. The iris dataset is also used below. First, the variable “specifications” needs to be eliminated, and then the diagram is drawn:

``````ggcorrmat(data = iris[, -5])
`````` picture

# 7. ggpiestats(): pie chart

#### If anyTwo categorical variables, which want to compare the rates by chi square test, it can be drawn in the form of pie chart. Use to mtcars dataset:

``````ggpiestats(data = mtcars, x = am, y = vs)
`````` picture

# 8. ggbarstats(): a histogram showing categorical variables

#### In addition to using the pie chart above, you can also use the histogram:

``````ggbarstats(data = mtcars, x = am, y = vs)
`````` picture

# 9. ggcoefstats(): plot the regression coefficient

#### For example, aLinear regression model, now you want to plot the regression coefficients of independent variables, you can do this:

``````mymodel <- lm(mpg ~ cyl + disp + hp, data = mtcars)
Ggcoefstats (mymodel) \`````` Picture png

# 10. one line of code to get everything done? Nothing is so easy in the world!

Although it is said that dream is one line of code to get everything done, it is impossible in reality! picture

Here is an example of how to further adjust the output image to meet your needs. Take the scatter diagram in part 4 as an example: picture

For example, Bayes is not used in the research, so we want toDelete a list of statistical values at the bottom of the picture, and feelSepal. The variable length does not conform to the normal distribution, soSelect SpearmanCorrelation (Pearson correlation by default), you can do this:

``````ggscatterstats(data = iris, x = Sepal.Length, y = Sepal.Width,
bf. Message = false, \\
Type = "nonparametric") \\`````` picture

### Well, that’s all for today. If it helps, remember to share it with those who need it!

Life is good, it’s better to have you

## openGauss gathers innovative power, cloud and MogDB accelerate community development

On December 28th, at the OpenGauss Summit 2021, &quot;Gathering the power of database innovation and chasing the sea of ​​stars in the digital age&quot;, Liao Xiangke, an academician of the Chinese Academy of Engineering, pointed out in his speech that the development of databases requires a team that can gather forces from multiple parties in […]