search for: log10

Displaying 20 results from an estimated 381 matches for "log10".

2002 Oct 14
4
log10(), floor() combo issue?
Hi all, in my search for a nice binary2decimal method, I received this nice code (thanx to Uwe Ligges): bindec <- function(b) sum(as.integer(unlist(strsplit(b, ""))) * 2^(floor(log10(b)):0)) It fails, however, with: > bindec(1000) [1] 4 Warning message: longer object length is not a multiple of shorter object length in: as.integer(unlist(strsplit(b, ""))) * 2^(floor(log10(b)):0) The reason is the combination of floor() and log10(): log10(1000) = 3 ok...
2011 Aug 28
2
-log10 of 0
Dear R users: Sorry for this simple question: I am writing a function where I would need to pickup p values and make -log10 of it. The p values are from an anova output and sometime it can yield me 0. -log10 (0) [1] Inf I can not replace Inf with 0, which not case here. This is restricting me to go further in the function and out me the error. You help is highly appreciated. Thanks; -- Ram H [[alternative HT...
2011 Jun 30
2
volcano plot.r
...volcano plot, i hope anybody can help me to solve the problem. #    volcano_plot.r # #    Author:    Amsha Nahid, Jairus Bowne, Gerard Murray #    Purpose:    Produces a volcano plot # #    Input:    Data matrix as specified in Data-matrix-format.pdf #    Output:    Plots log2(fold change) vs log10(t-test P-value) # #    Notes:    Group value for control must be alphanumerically first #              Script will return an error if there are more than 2 groups # #    Load the data matrix # # Read in the .csv file data<-read.csv("file:///Users/nadya/Desktop/praktikal UTM/TASKS1/RT BE EM...
2008 Mar 05
5
nls: different results if applied to normal or linearized data
Dear all, I did a non-linear least square model fit y ~ a * x^b (a) > nls(y ~ a * x^b, start=list(a=1,b=1)) to obtain the coefficients a & b. I did the same with the linearized formula, including a linear model log(y) ~ log(a) + b * log(x) (b) > nls(log10(y) ~ log10(a) + b*log10(x), start=list(a=1,b=1)) (c) > lm(log10(y) ~ log10(x)) I expected coefficient b to be identical for all three cases. Hoever, using my dataset, coefficient b was: (a) 0.912 (b) 0.9794 (c) 0.9794 Coefficient a also varied between option (a) and (b), 107.2 and 94.7, resp...
2012 Jun 22
2
Boxplot with Log10 and base-exponent axis
...onent. To illustrate with an example, I have some widely spread data that I chart plot using boxplot() [figure on the left]; the log="y" option of boxplot() I obtained the natural logarithm conversion of the data and the unfriendly notation baseE+exponent [figure on the centre]; if I log10 the data I obtain the desired plot, but the axis are showing only the exponent. [figure on the right]. Can anybody help? Best regards Luigi Marongiu, MSc ########### EXAMPLE ############ # generationg random numbers x<-runif(100, min=0, max=100000) # create plot par(mfrow =...
2009 Jul 30
3
Looping through R objects with $ operator and tags
Hi all, Suppose I want to set the values in a column to the log of the values of another column like so: object$LogDist <- log10(object$Distance) How do I loop through the objects if I have object1, object2, etc to perform this function? object1$LogDist <- log10(object1$Distance) object2$LogDist <- log10(object2$Distance) object3$LogDist <- log10(object3$Distance) I was trying to use the assign and paste function...
2011 Jun 20
2
(no subject)
...lcano. what is the mistake? what the plot could not display? # volcano_plot.r # # Author: Amsha Nahid, Jairus Bowne, Gerard Murray # Purpose: Produces a volcano plot # # Input: Data matrix as specified in Data-matrix-format.pdf # Output: Plots log2(fold change) vs log10(t-test P-value) # # Notes: Group value for control must be alphanumerically first # Script will return an error if there are more than 2 groups # # Load the data matrix # # Read in the .csv file data<-read.csv("input5.csv", sep=",", row.names=1, header=...
2007 Nov 14
2
Help with Bartlett's test on linear model
...rn how to use the Bartlett's test. > hellung$glucose <- factor(hellung$glucose, labels=c("Yes","No")) > attach(hellung) > tethym.gluc <- hellung[glucose=="Yes",] > tethym.nogluc <- hellung[glucose=="No",] > lm.nogluc <- lm(log10(diameter)~log10(conc), data=tethym.nogluc) > lm.gluc <- lm(log10(diameter)~log10(conc), data=tethym.gluc) I guess I have two questions. 1) How to use bartlett.test with linear model (using the model above) and 2) how to test for homogeneity of variances of linear models when there are more...
2006 Mar 23
2
Default lag.max in ACF
Hi, The default value for lag.max in ACF implementation is 10*log10(N) There several publications recommending setting lag.max to: - N/4 (Box and Jenkins, 1970; Chatfield, 1975; Anderson, 1976; Pankratz, 1983; Davis, 1986; etc.) - sqrt(N)+10 (Cryer, 1986) - 20<=N<=40 (Brockwell and Davis) Why R uses 10*log10(N) as a default? Please, give me a referenc...
2013 Jul 20
2
Different x-axis scales using c() in latticeExtra
...10, 5) predictor3 <- c(67, 22, 66, 41, 72, 64, 69, 63, 64, 70, 60, 75, 78) pred1_plot <- xyplot(response ~ predictor1, scales = list(log = TRUE, equispaced.log = FALSE), panel = function(x, y, ...) { panel.xyplot(x, y, type = c("p", "r"), cex = 2) panel.text(x = log10(8), y = log10(120), labels = "(a)") } ) pred2_plot <- xyplot(response ~ predictor2, scales = list(log = TRUE, equispaced.log = FALSE), panel = function(x, y, ...) { panel.xyplot(x, y, type = c("p", "r"), cex = 2) panel.text(x = log10(2), y = log10(120),...
2013 Mar 26
6
How do I show real values on a log10 histogram
Hi, I have a histogram with values logged to the base 10 hist(log10(x),breaks=60) How do I show the log values on the x-axis and a second x-axis showing the real values? Thanks -- Shane [[alternative HTML version deleted]]
2012 May 26
1
Kolmogorov-Smirnov test and the plot of max distance between two ecdf curves
...,50,100,70,650,1300,6900,1780,4930,1120,700,190,940, 760,100,300,36270,5610,249680,1760,4040,164890,17230,75140,1870,22380,5890,2430) length(a) b<-c(0,0,10,30,50,440,1000,140,70,90,60,60,20,90,180,30,90, 3220,490,20790,290,740,5350,940,3910,0,640,850,260) length(b) out<-ks.test(log10(a+1),log10(b+1)) # max distance D out$statistic f.a<-ecdf(log10(a+1)) f.b<-ecdf(log10(b+1)) plot(f.a, verticals=TRUE, do.points=FALSE, col="red") plot(f.b, verticals=TRUE, do.points=FALSE, col="green", add=TRUE) #inverse of ecdf a x.a<-get("x", envi...
2003 Jun 20
1
Power Law Exponents
...,mode="numeric") > linx = as.vector(linf$lin, mode="numeric") > liny = as.vector(linf$Freq, mode="numeric") > plot(linx, liny, pch=3, log="xy",main="Log-log", xlab="Indegree", ylab="Frequency - Indegree") > abline(lm (log10(vouty) ~ log10(voutx))) This gives me the semblance of the plot I want but the exponent is wrong and I have severe doubts about its correctness. As I am neither a mathematician or statistician, I would be very grateful for comments or guidance or correction. Best Regards Martin -- Martin H. Rob...
2004 Jun 26
1
S4 group "Math", "getGroupMembers", "genericForPrimitive"
Hi, I found the following on Windows 2000/NT R Version 1.9.1 (2004-06-21) (also Version 1.9.0): The S4 group "Math" doesn't work as documented; i.e., "log", "log10", "gamma" and "lgamma" are included in the documentation but don't work. See example code below. Moreover, what about 'genericForPrimitive' which is used in 'getGeneric'. It seems that this method is not included in the R Version 1.9.1 (also 1.9.0). See...
2010 Sep 15
1
HDP and 99% contour lines
Dear all, I have a very simple question about how I can include HPD confidence lines in a Marginal posterior distribution scatterplot I have the following code to draw the scatterplot(s) from an output table; par(mfrow=c(2,2)) plot(temp1[,5], temp1[,6], xlab="log10(r)", ylab="log10(tf)", pch=46) plot(temp2[,5], temp2[,6], xlab="log10(r)", ylab="log10(tf)", pch=46) plot(temp3[,5], temp3[,6], xlab="log10(r)", ylab="log10(tf)", pch=46) plot(temp4[,5], temp...
2010 May 27
1
4D Plot
...o, I need some help with a 4D-Plot. Here is my code: Lab.palette <- colorRampPalette(c("blue","turquoise","green","yellow","orange","red","violet"),space = "Lab") par(las=3,omi=c(0.8,0.1,0.1,0.1)) filled.contour(x,log10(y),log10(z=daten),col=Lab.palette(27),zlim = c(0,max(log10(daten))),plot.title="Unkorrigierte Mobilit?ten von Staub", ylab="Gr??enklassen",key.title="", plot.axes={axis(2,at=log10(ytick),label=ytick) axis(1,at=seq...
2013 Mar 13
1
expression exponent labeling
...axis with exponents, but can't get it done with expression. Any hints would be very welcome! # simulated data, somewhat similarly distributed to my real data: set.seed(12); d <- rbeta(1e6, 0.2,2)*150 ; d <- d[d>1e-8] hist( d? , breaks=100) # now on a logarithmically scaled axis: hist(log10(d), breaks=100, xaxt="n") abline(v= log10(1:10*10^rep(-9:3, each=10)), col="darkgrey" ); box() hist(log10(d), breaks=100, col="forestgreen", add=T) axis(1, log10(1:10*10^rep(-9:3, each=10)), labels=F) axis(1, -2:2, format(10^(-2:2), scient=3, drop0trailing=T) ) # the l...
2010 Sep 20
1
Please help with this error - new to
I am getting the following error in my script. I am very very new to R and have obtained this script from another person. #read file in (dummy data) starburst.plot<-function(affy.fold, affy.FDR)(ifelse( ((affy.fold) >=0), -1*log10(affy.FDR), 1*log10(affy.FDR))) starburst.plot<-function(meth.fold, meth.FDR)(ifelse( ((meth.fold) >=0), -1*log10(meth.FDR), 1*log10(affy.FDR))) At my next command, I get the following error: > g.ex.affy <- starburst.plot(data(,"affy.FOLD"), data(,"affy.FDR")) Error...
2009 Sep 06
5
ggplot2::qplot() -- arbitary transformations of coordinate system?
Hi, Does anyone know how to do a coord_trans() in which the y-axis is tranformed into (for example) -1000/y? Thanks, _____________________________ Professor Michael Kubovy University of Virginia Department of Psychology USPS: P.O.Box 400400 Charlottesville, VA 22904-4400 Parcels: Room 102 Gilmer Hall McCormick Road Charlottesville, VA 22903 Office: B011
2008 Aug 22
2
Newbie programming help
...th Weight 1 158 45 1 179 70 1 200 125 1 202 150 1 206 145 1 209 165 1 210 140 1 215 175 1 216 152 1 220 150 1 221 165 ... where lake goes from 1 - 84 and the number of rows for each lake is variable (but > ~20). I'm trying to do two things: 1) build a simple linear model of the form {lm(log10(Weight)~log10(Length)} for every separate lake in the data set; 2) I'd like to save the intercepts and slopes from each of these linear regressions into a seperate data frame. Any ideas? I think it would probably require some kind of 'for' statement, but I'm just not that smart...