ag.ds.t.test: Runs a student's t-test on horizontally partitioned data

Description Usage Arguments Details Value Author(s) Examples

Description

Performs one and two sample t-tests on vectors of data.

Usage

1
2
3
  ag.ds.t.test(opals, x, y = NULL, type = "combine",
    alternative = "two.sided", mu = 0, paired = FALSE,
    var.equal = FALSE, conf.level = 0.95)

Arguments

opals

a list of opal object(s) obtained after login in to opal servers; these objects hold also the data assign to R, as dataframe, from opal datasources.

x

a (non-empty) numeric vector of data values

y

an optional (non-empty) numeric vector of data values.

type

a character which tells if the test is ran for the pooled data or not. By default type is set to 'combine' and a t.test of the pooled data is carried out. If type is set to 'split', a t.test is ran for each study separately.

alternative

character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less". You can specify just the initial letter.

mu

a number indicating the true value of the mean (or difference in means if you are performing a two sample test).

paired

a logical indicating whether you want a paired t-test.

var.equal

a logical variable indicating whether to treat the two variances as being equal. If TRUE then the pooled variance is used to estimate the variance otherwise the Welch. (or Satterthwaite) approximation to the degrees of freedom is used.

conf.level

confidence level of the interval

Details

Summary statistics are obtained from each of the data sets that are located on the distinct computers/servers. And then grand means and variances are calculated. Those are used for performing t-test.

Value

a list containing the following elements: statistic the value of the t-statistic parameter the degrees of freedom for the t-statistic p.value p.value the p-value for the test conf.int a confidence interval for the mean appropriate to the specified alternative hypothesis estimate the estimated mean or difference in means depending on whether it was a one-sample test or a two-sample test null.value the specified hypothesized value of the mean or mean difference depending on whether it was a one-sample test or a two-sample test alternative a character string describing the alternative hypothesis method a character string indicating what type of t-test was performed

Author(s)

Isaeva, J.; Gaye, A.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
# load that contains the login details
data(logindata)

# login and assign specific variable(s)
myvar <- list("LAB_HDL", "LAB_TSC")
opals <- ag.ds.login(logins=logindata,assign=TRUE,variables=myvar)

# Example 1: Run a t.test of the pooled data for the variables 'LAB_HDL' and 'LAB_TSC' - default
ag.ds.t.test(opals=opals, x=quote(D$LAB_HDL), y=quote(D$LAB_TSC))

# Example 2: Run a t.test for each study separately for the same variables as above
ag.ds.t.test(opals=opals, x=quote(D$LAB_HDL), y=quote(D$LAB_TSC), type="split")

## End(Not run)

datashield/ag.dev.cl documentation built on May 14, 2019, 7:46 p.m.