Movatterモバイル変換


[0]ホーム

URL:


rdrr.io

proportions: Express Table Entries as Fraction of Marginal Table

proportionsR Documentation

Express Table Entries as Fraction of Marginal Table

Description

Returns conditional proportions givenmargins, i.e. entries ofx, divided by the appropriate marginal sums.

Usage

proportions(x, margin = NULL)prop.table(x, margin = NULL)

Arguments

x

table

margin

a vector giving the margins to split by.E.g., for a matrix1 indicates rows,2 indicatescolumns,c(1, 2) indicates rows and columns.Whenx has named dimnames, it can be a character vectorselecting dimension names.

Value

Table likex expressed relative tomargin

Note

prop.table is an earlier name, retained for back-compatibility.

Author(s)

Peter Dalgaard

See Also

marginSums.apply,sweep are a more general mechanism for sweeping out marginal statistics.

Examples

m <- matrix(1:4, 2)mproportions(m, 1)DF <- as.data.frame(UCBAdmissions)tbl <- xtabs(Freq ~ Gender + Admit, DF)proportions(tbl, "Gender")

What can we improve?

R Package Documentation

Browse R Packages

We want your feedback!

Note that we can't provide technical support on individual packages. You should contact the package authors for that.

 
Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, readEmbedding Snippets.

Close

[8]ページ先頭

©2009-2026 Movatter.jp