Stacks Image 20108

For Academics

Normalise data

When you need to compare different data with very different value ranges.

With clusterSim library

If x is the normalised data and y is the old data, we would like to do y = (x-mean(x))/sd(x)

One way is to use the clusterSim library

library(clusterSim)

Then a variable can be normalised for mean=0, variance=1 using:

data.Normalization(data$FRE,type="n1")

As a bonus, there are other types of normalisation (other than type="n1"). For more information look at the help file. ?data.Normalization.

Without any library

Alternatively, use:

x<-sweep(y, 2, apply(y, 2, mean), "-")
x<-sweep(x, 2, apply(x, 2, sd), "/")
names(x)<-paste("s", names(x), sep="")

Note that if any values are 0 the normalisation will generate infinite values, which may need to be dealt with.

Previous Post 6 / 10 Post

Tag:

Sex chromosome papers RSS


The genome sequence of the Southern Grizzled Skipper, Pyrgus malvoides (Elwes & Edwards, 1897) (Lepidoptera: Hesperiidae)
Link

The genome sequence of the Puss Moth, Cerura vinula (Linnaeus, 1758) (Lepidoptera: Notodontidae)
Link

The genome sequence of the Reed Leopard moth, Phragmataecia castaneae Hübner, 1790 (Lepidoptera: Cossidae)
Link