Displaying 20 results from an estimated 11013 matches for "scale".
2008 Apr 15
1
p-values always identical for t.test of certain group of samples, why ?
Hi,
Given the following,
a <- rnorm(5)
b <- rnorm(5)
c <- rnorm(5)
a.1g.scale <- scale(c(a,b,c))[1:5]
b.1g.scale <- scale(c(a,b,c))[6:10]
c.1g.scale <- scale(c(a,b,c))[11:15]
a.2g.scale <- scale(c(a,b))[1:5]
b.2g.scale <- scale(c(a,b))[6:10]
c.2g.scale <- scale(c)
a.3g.scale <- scale(a)
b.3g.scale <- scale(b)
c.3g.scale <- scale(c)
I am puzzled wh...
2010 Sep 24
0
kernlab:ksvm:eps-svr: bug?
...response vector, y, is standardized at line 143:
142 if (is.numeric(y)&&(type(ret)!="C-svc"&&type(ret)!="nu-svc"&&type(ret)!="C-bsvc"&&type(ret)!="spoc-svc"&&type(ret)!="kbb-svc"))
{
143 y <- scale(y)
144 y.scale <- attributes(y)[c("scaled:center","scaled:scale")]
145 y <- as.vector(y)
146 }
2. fitted response, fitted(ret), is obtained at lines 826,827:
826 fitted(ret) <- if (fit)
827 predict(ret, x) else NULL
(note: during...
2012 May 23
1
prcomp with previously scaled data: predict with 'newdata' wrong
Hello folks,
it may be regarded as a user error to scale() your data prior to prcomp() instead of using its 'scale.' argument. However, it is a user thing that may happen and sounds a legitimate thing to do, but in that case predict() with 'newdata' can give wrong results:
x <- scale(USArrests)
sol <- prcomp(x)
all.equal(predict(so...
2002 Aug 12
1
question about cloud() in lattice package
Hi all,
I have been previously been using scatterplot3d package to create some graphs but unfortunately it does not allow me to rotate the
plot on all three axis. The cloud() function in the lattice package does allow me to do so. When I was using scatterplot3d I was
using a script (Shown Below) to calculate the mean, quartiles and range limits for all three axis and I was representing that on the
2008 Aug 28
6
Function not returning a vector?
Why does:
(shape/scale) * (1:365/scale)^(shape - 1)
return a vector of numbers but calling a function
hasard(1:365,shape,scale)
defined like:
hazard <- function(x,shape,scale)
{
return (shape/scale) * (x/scale)^(shape - 1)
}
Only return a single value? It is like x becomes a single value passed as an argument....
2011 Jul 16
2
Utility function to apply a scale object on another data frame
Hi Everyone,
I would like to scale a data frame and then using the same scaling
parameters scale on another data frame. This will be helpful in scaling the
test dataset based on train dataset's scaling parameters. I couldn't find
any utility functions that do this. Any suggestions on how to approach this
problem?
x = data.f...
2005 Aug 31
1
Bioconductor and R-devel
...UK.
http://bioinformatics.picr.man.ac.uk/simpleaffy
mailto: microarray at picr.man.ac.uk
Background correcting
Retrieving data from AffyBatch...done.
Computing expression calls...
.........................done.
scaling to a TGT of 100 ...
Scale factor for: 0203_YH10_H_MCF7_r1.CEL 0.291660289301555
Scale factor for: 0203_YH11_H_MCF10A_r1.CEL 0.42025300545212
Scale factor for: 0203_YH12_H_a100MCF7_r1.CEL 0.287589038746987
Scale factor for: 0203_YH13_H_a100MCF10A_r1.CEL 0.451200408584071
Scale factor for: 0203_YH14_H_a10MCF7_r1.CEL 0.3854620...
2004 Jan 15
2
prcomp scale error (PR#6433)
Full_Name: Ryszard Czerminski
Version: 1.8.1
OS: GNU/Linux
Submission from: (NULL) (205.181.102.120)
prcomp(..., scale = TRUE) does not work correctly:
$ uname -a
Linux 2.4.20-28.9bigmem #1 SMP Thu Dec 18 13:27:33 EST 2003 i686 i686 i386
GNU/Linux
$ gcc --version
gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
> a <- matrix(rnorm(6), nrow = 3)
> sum((scale(a %*% svd(cov(a))$u, scale = F)[,1] - (prcomp(a...
2010 Feb 22
3
scale(x, center=FALSE) (PR#14219)
...0.1
year 2009
month 12
day 14
svn rev 50720
language R
version.string R version 2.10.1 (2009-12-14)
scale returns incorrect values when center=FALSE and scale=TRUE.
When center=FALSE, scale=TRUE, the "scale" used is not the square root of sample
variance, the "scale" attribute is equal to sqrt(sum(x^2)/(n-1)).
Example:
x <- runif(10)
n <- length(x)
scaled <- scale(x, ce...
2006 Sep 11
2
Translating R code + library into Fortran?
...#which attempts to test the estimation of weibull distribution parameters
#from sample data. In this implementation, their HB estimation method is
#replaced by an iterative neural network approach.
library(nnet)
data.gen=function(iterations,min.sample.size,max.sample.size,min.shift,max.shift,min.scale,max.scale,min.shape,max.shape){
#set up some collection vectors
sample.size=vector(mode="numeric",length=iterations)
exp.shift=vector(mode="numeric",length=iterations)
exp.scale=vector(mode="numeric",length=iterations)
exp.shape=vector(mode="nu...
2008 Jan 04
2
question about scale() function
Hi,
The documentation for scale() states:"If center is TRUE then centering is
done by subtracting the column means (omitting NAs) of x from their
corresponding columns". But it seems that R is subtracting something else
instead of the column mean:
> x=c(2,4,3,4,5)
> mean(x)
[1] 3.6
> x-mean(x)
[1] -1.6 0.4 -0...
2011 Oct 24
1
Adding points to a wireframe: 'x and units must have length >0' error
....frame(x = seq(-4, 0, 0.5), y = seq(0, 40, 5))-> df
expand.grid(x = df$x, y = df$y) -> gridd
(gridd$y* gridd$x) -> gridd$z
data.frame(x = runif(10, -4, 0), y = runif(10, 0, 40))-> pts1
pts1$z <- pts1$x*pts1$y
# plot
wireframe(z ~ y*x, gridd, drape = TRUE, colorkey= TRUE,
scales = list(arrows = FALSE),
pts = pts1,
panel.3d.wireframe =
function(x, y, z,xlim, ylim, zlim, xlim.scaled, ylim.scaled,
zlim.scaled, pts1, ...)
{
panel.3dwire(x = x, y = y, z = z,
xlim = c(-4, 0),...
2018 Feb 27
2
scale.default gives an incorrect error message when is.numeric() fails on a sparse row matrix (dgeMatrix)
I am attempting to use the lars package with a sparse input feature matrix,
but the following fails:
library(Matrix)
library(lars)
data(diabetes)
attach(diabetes)
x = as(as.matrix(as.data.frame(x)), 'dgCMatrix')
lars(x, y, intercept = FALSE)
Error in scale.default(x, FALSE, normx) :
>
> length of 'scale' must equal the number of columns of 'x'
>
>
More specifically, scale.default fails:
normx = new(
"dgeMatrix",
x = c(1.00000000000004, 1, 1.00000000000009,
1.00000000000001, 1.00000000000001,...
2003 Apr 03
1
SVM module: scaling data applied to new test set without using SVM again
Hello!
We are new in using R. We use the SVM module from the library ''e1071''
for training.
Problem formulation:
a classification has been performed using SVM module (linear kernel).
Later, a new data set (test set) comparable to the training data shall be
scaled in the same way as the training set (using the same scaling
parameter set, but without using the SVM again to save time). We found the
scaling matrices, but we do not know, how to apply them.
How must the scaling parameter matrices (scaled:center and scaled:scale)
be applied to the test data...
2005 Nov 18
2
Adding points to wireframe
...a few points on the surface. I read in a post from
Deepayan Sarkar that "To do this in a wireframe plot you would probably
use the panel function panel.3dscatter". Does someone have an example?
When calling panel.3dscatter with only x, y and z arguments I get
"argument "xlim.scaled" is missing, with no default". I do not know what
value I should give to xlim.scaled.
Ragards,
Pierre-Luc
2008 Apr 30
2
wireframe - add data points
...ginal data together with their predicted probabilities##
punten <- read.table("probs.csv",header=T,sep=";")
x <- punten[,1:1]
y <- punten[,2:2]
z <- punten[,3:3]
pts <- data.frame(x=x,y=y,z=z)
##end import original data##
wireframe(status~totalfrost*logtps,abc,scales=list(arrows=TRUE),drape=TRUE, screen =list (x=15, y=-50, z=-105), pts = pts,
panel.3d.wireframe =
function(x, y, z,
xlim, ylim, zlim,
xlim.scaled, ylim.scaled, zlim.scaled,
pts,
...) {
panel.3dwire(...
2004 Oct 20
2
Odd behaviour with scale()
Moi!
A student here has been getting a bit irritated with some side effects
of scale() (OS is Windows XP, the behaviour occurs in R 2.0.0, but not
1.7.1). The problem is that she scales a variable in a data frame, then
does a regression, and tries to get some predictions for some new data.
However, at this point she gets an error (see the example below). This
seems to be bec...
1998 Apr 24
1
Warning: ignored non function "scale"
I've been working on a revised version of prcomp and princomp. Below is my
current draft of prcomp, which is marginally different from V&R. I've added
center and scale as optional arguments. However, scale causes the following:
> zi _ prcomp(iris[,,2])
Warning: ignored non function "scale"
because scale is both a variable and a function. Is there any way to avoid this
error message and still keep the name scale for both the argument and the name
of...
2010 Jan 15
4
transposing a list of vectors
I have a list of vectors, all forced to be the same length:
testlist <- list(
shape=c(0, 0, 2),
cell.fill=c("red","blue","green"),
back.fill=rep("white",3),
scale.max=rep(100,3)
)
> str(testlist)
List of 4
$ shape : num [1:3] 0 0 2
$ cell.fill: chr [1:3] "red" "blue" "green"
$ back.fill: chr [1:3] "white" "white" "white"
$ scale.max: num [1:3] 100 100 100
>
I need to 'transpo...
2011 Sep 15
1
Lattice xyplot log scale labels help!
I have a problem with lattice log scales that I could use some help with.
I'm trying to print log y-axis scales without exponents in the labels.
A similar thread with Deepayan' recommendation is here:
http://tolstoy.newcastle.edu.au/R/e11/help/10/09/9865.html. For
example, this code using xyplot produces a logged y-axis but th...