Re: [R] matching type question, please

2021-12-16 Thread Bert Gunter
Not sure what you mean by this: "But this only works if the vectors xr* are longer than xs*." The solution I gave doesn't care about this. > a <- rbind(unique(z2),unique(z1)) > a[duplicated(a),] xs1 xs2 ## as before Presumably you are referring to your use of match() (which is how %in% is de

Re: [R] Using boot.ci "norm" not working

2021-12-16 Thread Rui Barradas
Hello, When the confidence interval is the normal CI, the return matrix has only 3 columns, all other CI's return a matrix with 5 columns. See section value in ?boot.ci. So just change $norm[, 4:5] to $norm[, 2:3] Hope this helps, Rui Barradas Às 22:24 de 16/12/21, varin sacha via R-hel

Re: [R] matching type question, please

2021-12-16 Thread Erin Hodgess
Wow! These are awesome! Thanks so much for the special cases! Erin On Thu, Dec 16, 2021 at 3:52 PM Rui Barradas wrote: > Hello, > > And here is another solution, addressing the problem raised by Bert and > avoiding unique. > > > xr1 <- 8:0 > xr2 <- 0:8 > xs1 <- 9:3 > xs2 <- 4 > cbind(xr1, xr2

Re: [R] matching type question, please

2021-12-16 Thread Rui Barradas
Hello, And here is another solution, addressing the problem raised by Bert and avoiding unique. xr1 <- 8:0 xr2 <- 0:8 xs1 <- 9:3 xs2 <- 4 cbind(xr1, xr2)[(xr1 %in% xs1) & (xr2 %in% xs2),] #xr1 xr2 # 4 4 xr1 <- c(1,2,1) xr2 <- c(4,5,4) xs1 <- c(6,6) xs2 <- c(7,7) cbind(xr1, xr2)[(xr1 %in%

[R] Using boot.ci "norm" not working

2021-12-16 Thread varin sacha via R-help
Dear R-experts, Here below my R code. Using "bca" in the boot.ci function at the end of my R code works perfectly. Using "perc" and "basic" perfectly works as well. But using "norm", my R code does not work anymore. Is it possible to solve that problem and to make my R code work ? #

Re: [R] matching type question, please

2021-12-16 Thread Bert Gunter
I am not sure Eric's solution is what is wanted: Consider: xr1 <- c(1,2,1) xr2 <- c(4,5,4) xs1 <- c(6,6) xs2 <- c(7,7) > z1 <- cbind(xr1, xr2) > z2 <- cbind(xs1,xs2) > z1 xr1 xr2 [1,] 1 4 [2,] 2 5 [3,] 1 4 > z2 xs1 xs2 [1,] 6 7 [2,] 6 7 If what is wanted is to find

Re: [R] matching type question, please

2021-12-16 Thread Eric Berger
> a <- cbind(c(xr1,xs1),c(xr2,xs2)) > a[duplicated(a)] [1] 4 4 On Thu, Dec 16, 2021 at 10:18 PM Erin Hodgess wrote: > > Hello! > > I have the following: > > cbind(xr1,xr2) > > xr1 xr2 > > [1,] 8 0 > > [2,] 7 1 > > [3,] 6 2 > > [4,] 5 3 > > [5,] 4 4 > > [6,] 3

[R] matching type question, please

2021-12-16 Thread Erin Hodgess
Hello! I have the following: cbind(xr1,xr2) xr1 xr2 [1,] 8 0 [2,] 7 1 [3,] 6 2 [4,] 5 3 [5,] 4 4 [6,] 3 5 [7,] 2 6 [8,] 1 7 [9,] 0 8 > cbind(xs1,xs2) xs1 xs2 [1,] 9 4 [2,] 8 4 [3,] 7 4 [4,] 6 4 [5,] 5 4

[R] write out a complete GAM fitted model equation, using parameter estimates

2021-12-16 Thread greg holly
Hi all, I have the following results from a study. I ran this model for binary distributed outcome log(event/non_event). I need to write out a complete GAM fitted model equation, using parameter estimates given below. I have difficulty putting the parameter estimates of Spline part in the fitted m

Re: [R] Changing time intervals in data set

2021-12-16 Thread Rich Shepard
On Wed, 15 Dec 2021, Avi Gross wrote: I still do not see what you want to do, sorry. Avi, Backing up to my original post on this thread I've realized that no one addressed my main question: do variable measurement intervals affect analyses of the data. And, if so, how and how to compensate fo

Re: [R] Changing time intervals in data set

2021-12-16 Thread Rich Shepard
On Thu, 16 Dec 2021, Chris Evans wrote: What you said earlier was: For me the next step, in tidyverse pseudocode, might be something like: tibData %>% arrange(nbr, datetime) %>% # just in case things are not ordered nicely group_by(site_nbr) %>% # as you want to get changes within site I