~ubuntu-branches/ubuntu/maverick/openturns/maverick

« back to all changes in this revision

Viewing changes to debian/rotRPackage/R/computeTestPartialRegression.R

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme
  • Date: 2008-10-03 10:55:20 UTC
  • Revision ID: james.westby@ubuntu.com-20081003105520-i4sqk110f19vp7hd
Tags: 0.12.1-6
* debian/rules: Fix FTBS on hppa, sparc, arm, and armel because of
  __sync_fetch_and_add_4 not being available, the remedy is to use
  -DBOOST_SP_USE_PTHREADS
* debian/rules: add --disable-debug option to configure and set the
  compiler flags to -g -O2 (no -Wall)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"computeTestPartialRegression" <-
 
2
function(outSample, inSample, selection, testLevel = 0.95) {
 
3
 
 
4
  # Perform lm on each selection.
 
5
  partialInSample <- inSample[,selection]
 
6
  lmSummary <- summary(lm(outSample ~ partialInSample))
 
7
 
 
8
  # The p-values are accessible via summary()
 
9
  pValues <- lmSummary$coefficients[,4]
 
10
  names(pValues) <- NULL
 
11
  
 
12
  testResult <- ifelse(pValues > 1 - testLevel, 1, 0)
 
13
  names(testResult) <- NULL
 
14
 
 
15
  return(list(test = "Regression",
 
16
              testResult = testResult,
 
17
              threshold = 1 - testLevel,
 
18
              pValue = pValues))
 
19
 
 
20
}
 
21