search for: slope

Displaying 20 results from an estimated 1098 matches for "slope".

Did you mean: scope
2012 Aug 16
8
How to extract from a column in a table?
Hi, I have a table in which one column has the name of the objects as shown below. Name Budlamp-Woodcutter Complex - 15 to 60% slope (60/25/15) Budlamp-Woodcutter Complex - 15 to 60% slope (60/25/15) Terrarossa-Blacktail-Pyeatt Complex - 1 to 40% slope (40/35/15/10) Terrarossa-Blacktail-Pyeatt Complex - 1 to 40% slope (40/35/15/10) How can I split the single column into three columns like name (Budlamp-Woodcutter Complex),...
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 seems ideal, but despite playing with the baseball examples quite a bit I can't figure out how to get it to work with my sample dataset. TI...
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 <- array(0,dim=c(udim,udim)) > diag(c...
2007 Aug 14
4
Linear Regression with slope equals 0
Hi there, am trying to run a linear regression with a slope of 0. I have a dataset as follows t d 1 303 2 302 3 304 4 306 5 307 6 303 I would like to test the significance that these points would lie on a horizontal straight line. The standard regression lm(d~t) doesn't seem to allow the slope to be set. Any help very welcome. ed
2011 Sep 16
3
Help writing basic loop
Hello, I would like to write a loop to 1) run 100 linear regressions, and 2) compile the slopes of all regression into one vector. Sample input data are: y1<-rnorm(100, mean=0.01, sd=0.001) y2<-rnorm(100, mean=0.1, sd=0.01) x<-(c(10,400)) #I have gotten this far with the loop for (i in 1:100) { #create the linear model for each data set model1<-lm(c(y1[i],y2[i])~x) slope1&...
2007 Nov 08
1
ggplot2 geom_abline slope not working?
I am learning ggplot2, and need your help. When I try > p <- ggplot(mtcars, aes(x = wt, y=mpg)) + geom_point() > p + geom_abline(slope=5) (from http://had.co.nz/ggplot2/geom_abline.html) the slope of the abline does not change, but this works: > p + geom_abline(intercept=20) In order to have slope work, I have to use > p + geom_abline(aes(slope=5)) Is it a bug, or is there some reason slope and intercept were treated d...
2003 Jul 21
5
how to test whether two slopes are sign. different?
Not really r-specific: Z = (b1 - b2) / SQRT ( SEb1^2 + SEb2^2) -------Original Message------- From: Gijsbert Stoet <stoet at volition.wustl.edu> Sent: 07/20/03 09:51 PM To: r-help at stat.math.ethz.ch Subject: [R] how to test whether two slopes are sign. different? > > Hi, suppose I do want to test whether the slopes (e.g. determined with lsfit) of two different population are significantly different, how do I test this (in R). Say for example, I found out what the slope between age and number of books read per year is for two...
2010 Sep 13
2
Homogeneity of regression slopes
...es, one of which we're using to split the data into 3 smaller subsets. (as the variable takes 1 of 3 possible values). There are several more variables too, many of which we're using to fit regression models using lm. So I have 3 models fitted (one for each subset of course), each having slope estimates for the predictor variables. What we want to find out, though, is whether or not the overall slopes for the 3 regression lines are significantly different from each other. Is there a way, in R, to calculate the overall slope of each line, and test whether there's homogeneity of regr...
2013 Mar 13
1
Determining maximum hourly slope per day
...temperatures of surface temperatures and so fluctuate during the day, heating up and then cooling down, so the data is a series of peaks and troughs. I would like to develop a function that would go through a dataset consisting of many sequential dates and determine for each day the maximum hourly slope of temp~date for each site (the fastest hourly rate of heating). The output would be the date, the maximum hourly slope for that date, and the location. It would also be great if I could extract when during the day the maximum hourly slope occurred. I have been playing around with using the packag...
2010 Nov 06
1
SMATR common slopes test
Hi All, I am confused with SMATR's test for common slope. My null hypothesis here is that all slopes are parallel (common slopes?), right? So if I get a p value < 0.05 means that we can have confidence to reject it? That slopes are different? Or the other way around? it means that we have statistical confidence that the slopes are parallel? thanks --...
2004 Mar 29
2
Confidence Intervals for slopes
Hi, I'm trying to get confidence intervals to slopes from a linear model and I can't figure out how to get at them. As a cut 'n' paste example: ################# # dummy dataset - regression data for 3 treatments, each treatment with different (normal) variance x <- rep(1:10, length=30) y <- 10 - (rep(c(0.2,0.5,0.8), each=10)*x)...
2006 Oct 25
3
simplification of code using stamp?
...I have the following code which I would like to simplify. Id does linear regressions and returns the r-squares, and the coefficients. It runs slow, as it is doing the regressions for each - is it possible to get the values in a dataframe which looks as follow: expert | xx | seeds | r.squared | slope | intercept Thanks in advance, Rainer library(reshape) rsqs <- as.data.frame( stamp( tc.long, expert * xx * seeds ~ ., function(df) try( summary( lm(distance ~ generation, data=df))...
2011 May 31
2
Forcing a negative slope in linear regression?
Dear forum members, How can I force a negative slope in a linear regression even though the slope might be positive? I will need it for the purpose of determining the trend due reasons other than biological because the biological (genetic) trend is not positive for these data. Thanks. Julia Example of the data: [1] 1.254 1.235 1.261 0.95...
2006 Feb 04
2
srt --- slope text with function?
[resent, plus small addition; I do not understand why gmail sent a weird charset.] Dear R wizards: I would love to write a general function that matches the slope of a plotted line in an xy-plot at a particular x,y location. something like x<- (1:10)^2; y<- 40:50; plot( x,y, type="l", xlim=c(0,90) ) srt.at5 = text.at.current.plot.with.slope( x, y, 5); text( x[5],y[5], pos=3, srt=srt.at.5); to do this, I first need to compute t...
2005 Oct 04
2
newbie questions - looping through hierarchial datafille
Dear List, Im new to R - making a transition from SAS. I have a space delimited file with the following structure. Each line in the datafile is identified by the first letter. A = Inventory (Inventory) X = Stratum (Stratum_no Total Ye=year established) P = Plot (Plot_no age slope= species) T = Tree (tree_no frequency) L = Leader (leader diameter height) F = Feature (start_height finish_height feature) On each of these lines there are some 'line specific' variables (in brackets). The data is hierarchical in nature - A feature belongs to a leader, a leader belongs...
2003 Feb 04
2
testing slope
Hi all, I try to test a linear slope using offset. I have: > m2 <- glm(Y~X*V) > summary(m2) Call: glm(formula = Y ~ X * V) Deviance Residuals: Min 1Q Median 3Q Max -2.01688 -0.56028 0.05224 0.53213 3.60216 Coefficients: Estimate Std. Error t value Pr(>|t|) (Inter...
2008 May 16
1
Making slope coefficients ``relative to 0''.
I am interested in whether the slopes in a linear model are different from 0. I.e. I would like to obtain the slope estimates, and their standard errors, ``relative to 0'' for each group, rather than relative to some baseline. Explicitly I would like to write/represent the model as y = a_i + b_i*x + E i = 1, ..., K, w...
2004 Jul 20
3
regression slope
Hello, I'm a newcomer to R so please forgive me if this is a silly question. It's that I have a linear regression: fm <- lm (x ~ y) and I want to test whether the slope of the regression is significantly less than 1. How can I do this in R? I'm also interested in comparing the slopes of two regressions: fm1 <- lm (x ~ y) fm2 <- lm (a ~ b) and asking if the slope of fm1 is less than the slope of fm2. Is this easy to do in R? I will be very grateful for...
2003 Jun 22
1
Using weighted.mean() in aggregate()
Dear R users, I have a question on using weighted.mean() while aggregating a data frame. I have a data frame with columns Sub, Length and Slope: > x[1:5,] Sub Length Slope 1 2 351.547 0.0025284969 2 2 343.738 0.0025859390 3 1 696.659 0.0015948968 4 2 5442.338 0.0026132544 5 1 209.483 0.0005304225 and I would like to calculate the weighted.mean of Slope, using Length as weights, for each value of Sub. The obvi...
2009 Apr 08
1
Genstat into R - Randomisation test
...utive defence (CD). Since Induced and constitutive defence are not independant (so called spurious correlation) I should do a randomisation test. I have a syntax of my supervisor in Genstat, but I would really like to try this in R. "data from trade-off.IDCD" list variate [nval=1000] slope calc ID1=ID graph ID; CD calc b=corr(ID; CD) calc slope$[1]=b "slope$[1] is the correlation before permutating the data" for i=2...1000 randomize ID1 calc b=corr(CD1; ID1) calc slope$[i]=b endfor hist slope describe slope quantile [proportion=!(0.0005,0.005, 0.025, 0.97...