Hello,
I'm glad that it helped.
Note, however, that you don't need inter.m <- as.matrix(...) because
inter$x already is a matrix.
You can simply do
inter.row <- nrow(inter$x)
answer <- inter$x[inter.row,1]
Rui Barradas
Citando Narendra Modi :
> Thanks! that worked.
>
> I also tested with t
Thanks! that worked.
I also tested with the below method although your solution is faster
and done in fewer steps.
inter <- intercept(segmented.mod)
inter.m <- as.matrix(inter$x)
inter.row <- nrow(inter.m)
answer <- inter.m[inter.row,1]
PD
On Tue, Jul 5, 2016 at 2:28 PM, wrote:
> Hell
l(inter[[1]], 1))
[1] -86.77
-
David L. Carlson
Department of Anthropology
Texas A&M University
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Narendra Modi
Sent: Tuesday, July 5, 2016 1:42 PM
To: R-help@r-project.
Hello,
Try
dimnames(inter$x)[[1]]
You could have seen this by inspecting 'inter':
str(inter)
Hope this helps,
Rui Barradas
Citando Narendra Modi :
> I am able to perform regression on a dataset as below:
>
> plot(x,y)
> lin.mod <- lm(y~x)
> m <- mean(x)
> m
>
> segmented.mod <- segmented(
I am able to perform regression on a dataset as below:
plot(x,y)
lin.mod <- lm(y~x)
m <- mean(x)
m
segmented.mod <- segmented(lin.mod, seg.Z = ~x, psi= m)
plot(segmented.mod, add=T)
sl <- slope(segmented.mod)
inter <- intercept(segmented.mod)
summary(segmented.mod)# Show Summary
sl
5 matches
Mail list logo