times-.svystat: A scalar multiplication method for 'svystat'

*.svystatR Documentation

A scalar multiplication method for svystat

Description

Multiply the values of survey statistics by a specified vector elementwise, adjusting the variance.

Usage

## S3 method for class 'svystat'
x * y

Arguments

x

an object of class ⁠[svystat][survey::svymean]⁠.

y

a numeric vector equal in length to x; shorter vectors will be recycled.

Value

a ⁠[svystat][survey::svymean]⁠ object with the updated statistics and variance-covariance matrix.

Examples

library(survey)
data(api)
# From example(svymean):
dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc)

(m1 <- svymean(~api99, dclus1))
(v1 <- vcov(m1))

# Scale the suvery stat object by a factor of two:
(m2 <- m1 * 2)
(v2 <- vcov(m2))



statnet/ergm.ego documentation built on Nov. 8, 2024, 11:44 p.m.