Displaying 20 results from an estimated 1300 matches similar to: "fitting a line to a logaritmic plot"
2007 Nov 15
2
Normalizing data
Hello,
I have a data set of about 300.000 measurements made by an STM which should
apporximately fix a normal (Gaussian) distribution.
I have imported the data in R and used plot(density()) to get a nice plot of
the distribution which in fact looks like a real Gaussian.
However, the integral over the surface is not equal to one (I know since
some of the plots extend to numbers greater then 1). Is
2009 Jun 18
1
lattice logaritmic scale (basis "e" ), rewriting labels using xscale.component
Hi there,
sorry for troubling everybody once again, I've got a problem rewriting
Sarkar's function for
rewriting the tick locations in a logaritmic way (s.
http://lmdvr.r-forge.r-project.org/code/Chapter08.R):
His example works for log 2 but I need log e (natural logarithm). My
problem is that if I replace
2 with "e" (using paste()), I get the error message that the location
2010 May 10
2
[Fwd: Re: Plotting log-axis with the exponential base to a plot with the default logarithm base 10]
Hello!
Thank you for answering!
What I am trying to do is to plot my raw values (biomass of different
species) on a logaritmic y-axis with the base of e. When I type "log="y"",
the axis transforms into a logaritmic axis with the base of 10.
Best regards,
Elisabeth
> Dear Elisabeth,
>
> I'm not sure if I have understood your question -- are you trying
> to
2010 May 09
3
Plotting log-axis with the exponential base to a plot with the default logarithm base 10
Hello!
I have a problem which I have tried to solve for several days now..
I have plottet a lineplot.CI in the library "sciplot", and I am trying to
plot it with a logaritmic y-axis (with exponential base).
The problem is that; when I type "log "y"", the axis transforms into the
logaritmic of base 10.
I wonder if someeone could tell me how to specify that I would
2025 Mar 29
4
Creating model formulas programmatically
Note: I am almost certain that this has been asked and answered here
before, so my apologies for the redundant query.
I also know that there are several packages that will do this, but I wish
to do it using base R functions only (see below).
The query: Suppose I have a character vector of names like this:
somenames <- c("Heigh", "Ho", "Silver", "Away")
2010 May 09
1
Plotting log-axis with the exponential base to a plot wi
Hello Ted!
Thank you a lot for your reply!!!
I will try to explain again; what I want is a logarithmic scaled y-axis
with the base of e (not 10). And the values I would like to use in the
plot are the raw values (not transformed in any way). Do you still think
that the base of log does not matter in this case (wheather it is e or 10
as a base)?
Elisabeth
> On 09-May-10 18:10:27, Elisabeth
2025 Mar 30
1
Creating model formulas programmatically
Another solution. reformulate + substitute + as.formula:
substitute(~ (.)^2, list(. = reformulate(somenames)[[2]])) |> as.formula()
On Sat, Mar 29, 2025 at 5:31?PM Bert Gunter <bgunter.4567 at gmail.com> wrote:
>
> Note: I am almost certain that this has been asked and answered here
> before, so my apologies for the redundant query.
>
> I also know that there are several
2025 Mar 30
1
Creating model formulas programmatically
Gabor, Duncan, et. al.
1. Thank you for your great comments and solutions. This is what I was
hoping for!
2. Duncan: I completely agree with your criticisms. In fact, I realized the
for() loop only needed the <- assignment, but your comment is important to
note. However, I didn't like the for() loop either; I *much* preferred your
Reduce() solution which is exactly the sort of elegant
2025 Mar 29
2
[External] Creating model formulas programmatically
Thanks, Rich.
I thought of that, too, but it violates the spirit of my restraints (to
avoid character strings), which I unfortunately did not clearly articulate.
So my apologies for that failure. My concern is that with more complex
model formula, using as.formula, etc. to parse/convert character strings
can get a bit hairy. But in most cases, as here maybe, it may be perfectly
fine. So think of
2025 Mar 29
1
[External] Creating model formulas programmatically
> somenames <- c("Heigh", "Ho", "Silver", "Away")
> as.formula(paste("~(",paste(somenames, collapse="+"),")^2"))
~(Heigh + Ho + Silver + Away)^2
>
> On Mar 29, 2025, at 14:30, Bert Gunter <bgunter.4567 at gmail.com> wrote:
>
> somenames <- c("Heigh", "Ho", "Silver",
2025 Mar 30
1
[External] Creating model formulas programmatically
As always, I would like to thank all who responded for their insights and
suggestions. I have learned from them.
Thus far, my own aesthetic preference -- and therefore not to be considered
in any sense as a "best" approach -- is to use Duncan's suggestion to
produce the call directly with call() rather than substitute in my simple
for() loop; i.e.
somenames <-
2004 Nov 17
1
R: log-normal distribution and shapiro test
Hi,
from what you're writing:
"The logaritmic transformation
"shapiro.test(log10(y))" says: W=0.9773, p-value=
2.512e-05." it seems the log-values are not
distributed normally and so original data are not
distributed like a log-normal: the p-value is
extremally small!
Other tests for normality are available in package:
nortest
compare the log-transformation of your ecdf
2025 Mar 30
1
[External] Creating model formulas programmatically
I am confused. Richard's answer that Bert did not like did not use parse explicitly. Richard pasted together a string that a function like lm() will have to parse to run the analysis. However, the answers so far do not use parse(). In the reply to Richard, Bert indicated we cannot use strings. Even if I pass a vector where R can assume that the first variable is the dependent variable and all
2025 Mar 30
1
[External] Creating model formulas programmatically
my take of the assignment was to avoid 'parse' specifically.
we start with a character vector, so avoiding characters is not possible. i was dealing with the fortune "if parse is the answer, you have the wrong question"
Sent from my iPhone
On Mar 29, 2025, at 15:39, Bert Gunter <bgunter.4567 at gmail.com> wrote:
?
Thanks, Rich.
I thought of that, too, but it violates
2025 Mar 29
1
[External] Creating model formulas programmatically
The general formula is y ~ a + b + c + ...
There is this approach:
formula <- reformulate(independent_vars, response = "y")
model <- lm(formula, data = mydata)
summary(model)
It does not generate a string object, but the formula is still a string even if it is of class formula. Also, in this approach you only get + and if you want interactions or such you will need to code them
2025 Mar 30
1
[External] Creating model formulas programmatically
Hello,
I thought of answering "reformulate can solve the problem" but how do
you create quadratic terms with reformulate?
~(Heigh + Ho + Silver + Away)^2
is still a problem with no solution that I know of but paste/as.formula.
Or Bert's bquote or substitute.
Rui Barradas
?s 23:18 de 29/03/2025, Ebert,Timothy Aaron escreveu:
> The general formula is y ~ a + b + c + ...
>
2004 Jan 20
2
avas and ace
Hi,
Does any one know how we can decide on the correct transformation in (avas and ace) after having drawn the graphs y,g(y) x ,s(x) and g(y) ,s(x) . Is it possible by only looking at patterns the graphs follow for example when
y ,g(y) shows a logaritmic pattern can we say that log transform on y is suitable?
Thanks for your help.
Regards
[[alternative HTML version deleted]]
2010 May 11
0
[Fwd: Re: Plotting log-axis with the exponential base to a plot with the default logarithm base 10]
Is it the tick labels that you want to change?
-----Original Message-----
From: "Elisabeth Bjerke Rastad" <ebr024 at post.uit.no>
To: "r-help at r-project.org" <r-help at r-project.org>
Sent: 5/10/10 11:20 AM
Subject: [R] [Fwd: Re: Plotting log-axis with the exponential base to a plot with the default logarithm base 10]
Hello!
Thank you for answering!
What I am
2003 May 18
1
log scale y axis ticks control?
Hello R Users!
I'm using lattice to produce some graphs with logaritmic y-scales. I use
the command
xyplot(hits ~ c(1:1024), data=eichData, type="S", scales=list(y =
list(log=10)))
to create the plot. This is fine, except for the automatically choosen
tick marks. I'd like to have a major tick at the 10^n location and minor
ticks in between which correspond with the native
2008 Dec 12
1
How to mimic select.list using RGtk2/gWidgetsRGtk2?
I want to write a function mimic the function of select.list(), here
is my preliminary version.
select <- function(x,multiple=TRUE,...){
ans<-new.env()
g <- gwindow(title=title,wid=200,heigh=500)
x1<-ggroup(FALSE,con=g)
x2<-gtable(x,multiple=multiple,con=x1,expand=TRUE)
gbutton("OK",con=x1,handler=function(h,...){
value <- svalue(x2)
if (length(value)==0)