Displaying 10 results from an estimated 10 matches for "slope1".
Did you mean:
slope
2011 Sep 16
3
Help writing basic loop
...e 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<-model1$coefficients[2]
}
How can I compile the slopes from all 100 regressions into one vector?
Thanks,
Jake
[[alternative HTML version deleted]]
2006 Jul 11
1
test regression against given slope for reduced major axis regression (RMA)
...erlimit95 give the 95 percent confidence
### intervall (two-tailed).
###
### see Sokal and Rohlf, p. 465/471
n <- length(x)
mydf <- n-2
## least square fit:
x2 <- (x-mean(x))^2
y2 <- (y-mean(y))^2
## regression (pedestrian solution):
xy <- (x-mean(x))*(y-mean(y))
slope1 <- sum(xy)/sum(x2)
intercept_a <- mean(y) - slope1 * mean(x)
## model data y_hat:
y_hat <- intercept_a + slope1 * x
## least squares of model data:
y_hat2 <- (y - y_hat)^2
s2yx <- sum(y_hat2) / (n-2)
sb <- sqrt(s2yx/sum(x2))
ts <- (slope1 - slope_2) / sb
pva...
2005 Jun 08
2
Robustness of Segmented Regression Contributed by Muggeo
...Initial break points are 1.2 and 1.5. The estimated break points and slopes:
Estimated Break-Point(s):
Est. St.Err
Mean.Vel 1.285 0.05258
1.652 0.01247
Est. St.Err. t value CI(95%).l
CI(95%).u
slope1 0.4248705 0.3027957 1.403159 -0.1685982 1.018339
slope2 2.3281445 0.3079903 7.559149 1.7244946 2.931794
slope3 9.5425516 0.7554035 12.632390 8.0619879 11.023115
Adjusted R-squared: 0.9924.
Result2:
Initial break points are 1.5 and 1.7. The es...
2010 Apr 08
2
Overfitting/Calibration plots (Statistics question)
This isn't a question about R, but I'm hoping someone will be willing
to help. I've been looking at calibration plots in multiple regression
(plotting observed response Y on the vertical axis versus predicted
response [Y hat] on the horizontal axis).
According to Frank Harrell's "Regression Modeling Strategies" book
(pp. 61-63), when making such a plot on new data
2005 Jan 20
1
Windows Front end-crash error
...,250)
Sigma<-matrix(c(400,80,80,80,80,400,80,80,80,80,400,80,80,80,80,400),4,4
)
mu2<-c(0,0,0)
LE<-8^2 #Linking Error
Sigma2<-diag(LE,3)
sample.size<-5000
N<-100 #Number of datasets
#Take a single draw from VL distribution
vl.error<-mvrnorm(n=N, mu2, Sigma2)
intercept1 <- 0
slope1 <- 0
intercept2 <- 0
slope2 <- 0
for(i in 1:N){
temp <- data.frame(ID=seq(1:sample.size),mvrnorm(n=sample.size,
mu,Sigma))
temp$X5 <- temp$X1
temp$X6 <- temp$X2 + vl.error[i,1]
temp$X7 <- temp$X3 + vl.error[i,2]
temp$X8 <- temp$X4 + vl.error[i,3]
long<-re...
2011 Apr 22
2
statistic Q
Dear,
i am a student and I need help in comparing between different slopes and
finding whther there is a significant difference between them?
Thanks a lot
[[alternative HTML version deleted]]
2005 Jun 10
0
Replies of the question about robustness of segmented regression
...Initial break points are 1.2 and 1.5. The estimated break points and slopes:
Estimated Break-Point(s):
Est. St.Err
Mean.Vel 1.285 0.05258
1.652 0.01247
Est. St.Err. t value CI(95%).l
CI(95%).u
slope1 0.4248705 0.3027957 1.403159 -0.1685982 1.018339
slope2 2.3281445 0.3079903 7.559149 1.7244946 2.931794
slope3 9.5425516 0.7554035 12.632390 8.0619879 11.023115
Adjusted R-squared: 0.9924.
Result2:
Initial break points are 1.5 and 1.7. The es...
2017 Dec 20
1
Nonlinear regression
..., 69.12, 237.7, 419.77)
>qe <- c(17.65, 30.07, 65.36, 81.7, 90.2)
>
>##The linearized data
>celin <- 1/ce
>qelin <- 1/qe
>
>plot(ce, qe, xlim = xlim, ylim = ylim)
>
>##The linear model
>fit1 <- lm(qelin ~ celin)
>intercept1 <- fit1$coefficients[1]
>slope1 <- fit1$coeffecients[2]
>summary(fit1)
>
>Qmax <- 1/intercept1
>Kl <- .735011*Qmax
>
>xlim <- range(ce, celin)
>ylim <- range(qe, qelin)
>
>abline(lm(qelin ~ celin))
>
>c <- seq(min(ce), max(ce))
>q <- (Qmax*Kl*c)/(1+(Kl*c))
>
>lines(c,...
2009 Apr 08
2
Null-Hypothesis
...td <- db/sd
> 2*pt(-abs(td), df)
My value I get by running this test is :[1] 2.305553e-07
Does it mean the two slopes differ significantly, because this value is in
the alpha area, so that I have to reject the null- hypothesis and accept
the alternative hypothesis?
Is the null-hypothesis: slope1=slope2?
Thanks for your help, Benedikt
--
2017 Dec 20
0
Nonlinear regression
....36, 81.7, 90.2)
> >
> >##The linearized data
> >celin <- 1/ce
> >qelin <- 1/qe
> >
> >plot(ce, qe, xlim = xlim, ylim = ylim)
> >
> >##The linear model
> >fit1 <- lm(qelin ~ celin)
> >intercept1 <- fit1$coefficients[1]
> >slope1 <- fit1$coeffecients[2]
> >summary(fit1)
> >
> >Qmax <- 1/intercept1
> >Kl <- .735011*Qmax
> >
> >xlim <- range(ce, celin)
> >ylim <- range(qe, qelin)
> >
> >abline(lm(qelin ~ celin))
> >
> >c <- seq(min(ce), max(ce...