English 中文(简体)
编制年龄、体重和绝对值、相对频率、性别指数
原标题:Create table (in R) with Average,Sd,CI (descriptive analysis) for age and Weight and Absolute,relative frequencies,Cumulative frequencies for gender
  • 时间:2024-05-03 00:57:41
  •  标签:
  • r
  • basic

How to create a table that I can present continuous variable such as (Age , weight) with descriptive analysis (Average,Sd,95% Confidence interval for the average ) and present categorical variable in one table with Absolute , relative frequencies and also, cumulative frequencies .

我根据其他变量增加了新的变量,但当我试图利用这一新的变量时,它给我带来了“未发现”的变量。

I am start learning how to create table to present statistics .Which packages that I can use and how do it even for continuous variable or categorical.

问题回答

For future reference including your code is always good when asking a question. It gives a better idea of what you re actually trying to accomplish. There is a ton of different packages that produce summary statistics. In the base R environment, you can call summary(your.data.frame) and it gives some basic info.

当你开始走更深的路时,每个人都会有自己的选择,我实际上就象总结统计数据的心理包。

If you aren t familiar and are still learning. This package can be installed and loaded using:

install.packages("psych")
library(psych)

From here, you can use describe(your.data.frame) and index the columns with the statistics you want to store for a new data frame. For example:

new.df <- describe(your.data.frame)[,c(2,4,7,9)]

These are the columns you want to pull from. I m not familiar with a package that also includes a T-test for variable CI s in an all in one stop. However, the base R package has a nice function that can perform a t-test to produce CI s for a vector.

t.test(your.data.frame$your.variable, conf.level = 0.95)$conf.int

它将在特定变量上进行笔试。 你们可能不得不在把成果指数化的同时发挥作用。 你们可以动用这笔钱。 公开并提供更多信息供你选择。

对于你关于分类变量的简要统计数据的问题,你可以将这些数据从原来的数据框架中排出,并利用某些不同的方法得出你想要的结果。 我将不断更新,但现在将检查这一联系。

https://bookdown.org/rwnahhas/IntroToR/summarizing-categorical-data.html





相关问题
How to plot fitted model over observed time series

This is a really really simple question to which I seem to be entirely unable to get a solution. I would like to do a scatter plot of an observed time series in R, and over this I want to plot the ...

REvolution for R

since the latest Ubuntu release (karmic koala), I noticed that the internal R package advertises on start-up the REvolution package. It seems to be a library collection for high-performance matrix ...

R - capturing elements of R output into text files

I am trying to run an analysis by invoking R through the command line as follows: R --no-save < SampleProgram.R > SampleProgram.opt For example, consider the simple R program below: mydata =...

R statistical package: wrapping GOFrame objects

I m trying to generate GOFrame objects to generate a gene ontology mapping in R for unsupported organisms (see http://www.bioconductor.org/packages/release/bioc/vignettes/GOstats/inst/doc/...

Changing the order of dodged bars in ggplot2 barplot

I have a dataframe df.all and I m plotting it in a bar plot with ggplot2 using the code below. I d like to make it so that the order of the dodged bars is flipped. That is, so that the bars labeled "...

Strange error when using sparse matrices and glmnet

I m getting a weird error when training a glmnet regression. invalid class "dgCMatrix" object: length(Dimnames[[2]]) must match Dim[2] It only happens occasionally, and perhaps only under larger ...

Generating non-duplicate combination pairs in R

Sorry for the non-descriptive title but I don t know whether there s a word for what I m trying to achieve. Let s assume that I have a list of names of different classes like c( 1 , 2 , 3 , 4 ) ...

Per panel smoothing in ggplot2

I m plotting a group of curves, using facet in ggplot2. I d like to have a smoother applied to plots where there are enough points to smooth, but not on plots with very few points. In particular I d ...

热门标签