Displaying 20 results from an estimated 10000 matches similar to: "problem in plot after calculating the derivative"
2008 Oct 15
1
Parameter estimates from an ANCOVA
Hi all,
This is probably going to come off as unnecessary (and show my ignorance)
but I am trying to understand the parameter estimates I am getting from R
when doing an ANCOVA. Basically, I am accustomed to the estimate for the
categorical variable being equivalent to the respective cell means minus the
grand mean. I know is the case in JMP - all other estimates from these data
match the
2017 Sep 19
2
symbolic computing example with Ryacas
Hi all,
I am trying to implement the following matlab code with Ryacas :
syms U x x0 C
d1=diff(U/(1+exp(-(x-x0)/C)),x);
pretty(d1)
d2=diff(U/(1+exp(-(x-x0)/C)),x,2);
pretty(d2)
solx2 = solve(d2 == 0, x, 'Real', true)
pretty(solx2)
slope2=subs(d1,solx2)
I have tried the following :
library(Ryacas)
x <- Sym("x");U <- Sym("U");x0 <-
2017 Sep 19
1
symbolic computing example with Ryacas
Thanks for the response. Yes, I did study the vignette but did not
understand it fully. Anyway, I have tried once again now. I am happy to say
that I have got what I wanted.
library(Ryacas)
x <- Sym("x");U <- Sym("U");x0 <- Sym("x0");C <- Sym("C")
my_func <- function(x,U,x0,C) {
return (U/(1+exp(-(x-x0)/C)))}
FirstDeriv <-
2017 Sep 19
0
symbolic computing example with Ryacas
Have you studied the "Introduction to Ryacas" vignette that come with the
package?
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Tue, Sep 19, 2017 at 2:37 AM, Vivek Sutradhara <viveksutra at gmail.com>
wrote:
2010 Jul 23
1
calculate slope of line
Dear All,
I fear that this is a really easy question but I do seem to go around in
circles..
I have 2 points on a plot and would like to calculate the slope of the
line drawn through these 2 points.
that cant be so hard?!
Thank you in advance,
Katrin
--
Katrin Fleischer
Vrije Universiteit Amsterdam
Faculty of Earth and Life Sciences
Subdepartment Hydrolgy and Geo-Environmental Sciences
Room
2006 Mar 05
2
plotting partial deriviatives
Dear R Helpers:
I am trying to annotate a plot. The following code snippet works, but it is
kind of a kludge since it adds the partial derivative symbols after creating
the plotmath frac(). Is there a more elegant way to write a partial
derivative?
dev.off()
plot(NA, xlim=c(-3,3), ylim=c(0,1.6), xlab="", ylab="", tck=-0.015)
text(1.6, 1, expression(paste("slope =
2010 Oct 17
4
Variable name as string
Hello,
from Verzani, simpleR (pdf), p. 80, I created the following function to
test the coefficient of lm() against an arbitrary value.
coeff.test <- function(lm.result, var, coeffname, value) {
# null hypothesis: coeff = value
# alternative hypothesis: coeff != value
es <- resid(lm.result)
coeff <- (coefficients(lm.result))[[coeffname]]
# degrees of freedom = length(var) -
2003 Sep 04
1
error in lm.fit
Hello R user,
I have several data frames with >100 columns and I did a linear regression
over time of each column
df1.lm <- lapply(df1, function(x) lm(x~year)$coeff[2])
that worked fine and I get slope of each column oder time - until I divided
df1 by df2
df3 <- df1/df2
> df3.lm <- lapply(df3, function(x) lm(x~year)$coeff[2])
Error in lm.fit(x, y, offset = offset, ...) :
2010 Apr 27
3
Problem calculating multiple regressions on a data frame.
Hi there,
I am stuck trying to solve what should be a fairly easy problem.
I have a data frame that essentially consists of (ID, time as seqMonth,
variable, value) and i want to find the regression coefficient of value vs
time for each combination of ID and Variable.
I have tried several approaches and none of them seems to work as i
expected.
For example, i have tried:
2007 Dec 02
3
Help with a Loop
I am having trouble getting a loop to work for the following problem. Any
help would be much appreciated. Thanks.
I need to find the slope and intercept from the linear regression of Drug
Level on Day by Participant. There are a total of 37 Participants. I need to
store the Participant, Label, Slope, and Intercept in a new data frame.
This data is ordered by Participant number 37 total
2011 Aug 25
2
apply function to spatial grid data frame to calculate CTI
Dear R helpers,
I'm new to R and struggling with applying functions to a spatial grid data frame, called data for example.data has a variable named "slope" and "uparea"
Basically, I need to calculate the tan(data$slope)Next, I need to divide data$uparea by data$slope and take the log() of that all
In the basic examples I found how to make simple multiplications with a
2008 Nov 03
2
Calculating R2 for a unit slope regression
Does anyone know of a literature reference, or a piece of code that can help me calculate the amount of variation explained (R2 value), in a regression constrained to have a slope of 1 and an intercept of 0?
Thanks!
Sebastian
J. Sebastián Tello
Department of Biological Sciences
285 Life Sciences Building
Louisiana State University
Baton Rouge, LA, 70803
(225) 578-4284 (office and lab.)
2009 Dec 09
1
Bootstrapping in R
Dear all,
I have some error trying to bootstrap from a matrix. The error message is
"Error in sample(n, n * R, replace = TRUE) : element 2 is empty;
the part of the args list of '*' being evaluated was: (n, R)"
vv <- c(0.5,3.2,5.4,1.1,1.4,1.2,2.3,2.0)
Reg <- matrix(data=vv, nrow = 4, ncol = 2)
bootcoeff <- function(x){
coefficients(lm(x[,1]~x[,2]))[2]+1
}
2008 May 27
5
Rotated text on a regression line
Dear all,
I stumbled over a problem recently when trying to use srt with text() on a
windows device.
What I intended to do was to plot a simple regression line, and to rotate
a piece of text such that the text has the same angle as the regression
line.
However, the text is always plotted in a slightly wrong angle:
####
x=1:10 #create arbitrary x and y values
y=x*2-rnorm(1:10)
2005 Mar 01
1
constraining initial slope in smoother.spline
Hello. I want to fit a smoother spline (or an equivalent local
regression method) to a series of data in which the initial value of the
1st derivative (slope) is constrained to a specific value. Is it
possible to do this? If so, how?
Bill Shipley
[[alternative HTML version deleted]]
2009 Oct 19
2
How to get slope estimates from a four parameter logistic with SSfpl?
Hi,
I was hoping to get some advice on how to derive estimates of slopes from four parameter logistic models fit with SSfpl.
I fit the model using:
model<-nls(temp~SSfpl(time,a,b,c,d))
summary(model)
I am interested in the values of the lower and upper asymptotes (parameters a and b), but also in the gradient of the line at the inflection point (c) which I assume tells me my rate of
2012 Jan 22
2
Calculating & plotting a linear regression between two correlated variables
Hi,
I have a Community (COM) composed of 6 species: A, B, C, D, E & F.
The density of my Community is thus (Eq.1): dCOM = dA + dB + dC + dE + dF
I would like to calculate and plot a linear regression between the density
of each of my species and the density of the whole community (illustrating
how the density of each species varies with variations of the whole
community).
For example, I would
2006 Nov 29
1
simple R question
Hi,
I am new to this, can anyone help.
I am working with matrices, with stocknames as colNames and dates as
rowNames.
The data coontains percentile ranking for the stocks.
Date IBM MSFT 20061122 12 4 20061115 12 4
20061108
12 4 20061101 12 4 20061025 12 4 20061018 12 4 20061011
11 3 20061004 12 3 20060927 10 3
I would like to calculate the
2010 Aug 26
3
Help with ddply to eliminate a for..loop
I created a small example to show something that I do a lot of. "scale"
data by month and return a data.frame with the output. "id" represents
repeated observations over "time" and I want to scale the "slope"
variable. The "out" variable shows the output I want. My for..loop
does the job but is probably very slow versus other methods. ddply
2009 Nov 30
3
bug or bizarre feature?
Hello,
I'm running into a very strange problem:
> xrange <- c(-2.5,2.5)
> xdim <- 100
> mobility <- 0.1
> slope <- 1.16
> urange <- slope*xrange
> udim <- max(slope*xdim,5)
> du <- (urange[2]-urange[1])/udim
> uvec <- urange[1]+(1:udim-0.5)*du
> # type dependent weight function
> ckern <-