Re: [R] Bias-corrected percentile confidence intervals

2017-08-17 Thread Joe Ceradini
It was very statsy...I shoulda known better :) stats.stackexchange answer, for posterity: https://stats.stackexchange.com/questions/298506/bias-corrected-percentile-confidence-intervals Joe On Wed, Aug 16, 2017 at 1:30 PM, Joe Ceradini wrote: > Hi folks, > > I'm trying to

[R] Bias-corrected percentile confidence intervals

2017-08-16 Thread Joe Ceradini
Hi folks, I'm trying to estimate bias-corrected percentile (BCP) confidence intervals on a vector from a simple for loop used for resampling. I am attempting to follow steps in Manly, B. 1998. Randomization, bootstrap and monte carlo methods in biology. 2nd edition., p. 48. PDF of the approach/ste

Re: [R] string pattern matching

2017-03-23 Thread Joe Ceradini
abels <- attr(terms(fmla), "term.labels") > >> all(c("X1","X3") %in% term.labels) > >> } > >> > >>> f("X3 + X2 + X1") > >> [1] TRUE > >>> f("- X3 + X2 + X1") > >> [1] FALSE >

Re: [R] string pattern matching

2017-03-23 Thread Joe Ceradini
ot;) %in% term.labels) > } > >> f("X3 + X2 + X1") > [1] TRUE >> f("- X3 + X2 + X1") > [1] FALSE >> f("X3 + X2 + log(X1)") > [1] FALSE >> f("X3 + X2 + log(X1) + X1") > [1] TRUE > Bill Dunlap > TIBCO Software >

Re: [R] string pattern matching

2017-03-22 Thread Joe Ceradini
ep(FALSE,nbits) >> for(i in 1:nbits) if(length(grep(xbits[i],x2))) xans[i]<-TRUE >> return(all(xans)) >> } >> multigrep("x1 + x3","x1 + x2 + x3") >> [1] TRUE >> multigrep("x1 + x4","x1 + x2 + x3") >> [1] FALSE >

[R] string pattern matching

2017-03-21 Thread Joe Ceradini
Hi Folks, Is there a way to find "x1 + x2 + x3" given "x1 + x3" as the pattern? Or is that a ridiculous question, since I'm trying to find something based on a pattern that doesn't exist? test <- c("x1", "x2", "x3", "x1 + x2 + x3") test [1] "x1" "x2" "x3" "x1 + x2 +

Re: [R] Lubdridate: subset based on hour and minute

2017-01-02 Thread Joe Ceradini
0 39600 > > > > as.numeric(hm("10:00")) > [1] 36000 > > > > -Roy > > > > On Jan 2, 2017, at 12:39 PM, Joe Ceradini wrote: > > > > Bingo! Thanks! I somehow couldn't find an example like that via google. > > > > Joe > >

Re: [R] Lubdridate: subset based on hour and minute

2017-01-02 Thread Joe Ceradini
0S" "11H 0M 0S" > > -Roy > > >> On Jan 2, 2017, at 12:27 PM, Joe Ceradini wrote: >> >> Thanks for the reply Roy! >> >> Perhaps you're showing me the way and I'm missing it - how would I >> subset to only 1030 and 1100, exc

Re: [R] Lubdridate: subset based on hour and minute

2017-01-02 Thread Joe Ceradini
anks again. On Mon, Jan 2, 2017 at 1:13 PM, Roy Mendelssohn - NOAA Federal wrote: > Hi Joe: > > See below. >> On Jan 2, 2017, at 12:01 PM, Joe Ceradini wrote: >> >> Hi folks, >> >> I must be missing something obvious/painfully simple here >> >>

[R] Lubdridate: subset based on hour and minute

2017-01-02 Thread Joe Ceradini
Hi folks, I must be missing something obvious/painfully simple here How do I subset a time vector based on hours AND minutes? So, in this example, I want all time greater than 10:00, i.e., 10:30 and 11:00. I'm working with lubridate which separates the hours and minutes into separate slots.

Re: [R] Extract word from string based on pattern match

2016-10-24 Thread Joe Ceradini
ested in seeing those solutions as well. Thanks, Joe On Mon, Oct 24, 2016 at 3:42 PM, David Wolfskill wrote: > > On Mon, Oct 24, 2016 at 03:33:20PM -0600, Joe Ceradini wrote: > > R Helpers, > > > > I would like to extract the entire word beginning with "BT" (

[R] Extract word from string based on pattern match

2016-10-24 Thread Joe Ceradini
R Helpers, I would like to extract the entire word beginning with "BT" (or "BT-") and not any thing else in the string. Or, I would like to extract from BT up until the next space. test <- data.frame(x = c("abc", "Sample BT-1501-2E stuff", "Bt-1599-3E stuff")) test So, from test$x I would like t

Re: [R] Split strings based on multiple patterns

2016-10-19 Thread Joe Ceradini
at gives you more flexibility in specifying what to look > for in the structure of the data, then extract only those pieces that > you want. > > > On Fri, Oct 14, 2016 at 5:16 PM, Joe Ceradini > wrote: > > Afternoon, > > > > I unfortunately inherited a dat

Re: [R] Split strings based on multiple patterns (plain text)

2016-10-15 Thread Joe Ceradini
mercy :) Joe Ceradini University of Wyoming ~~~ On 10/14/16, David Wolfskill wrote: > Happy Friday, indeed. > > It seems to me that the data need a bit of cleamup before attempting to > parse -- for example, that "F" looks to b

Re: [R] Split strings based on multiple patterns (plain text)

2016-10-14 Thread Joe Ceradini
should be strsplit(ugly, attributes) not strplit(ugly, attributes) On Fri, Oct 14, 2016 at 7:53 PM, Joe Ceradini wrote: > Hopefully this looks better. I did not realize gmail default was html. > > I have a dataframe with a column that has many field smashed together. > I need

[R] Split strings based on multiple patterns (plain text)

2016-10-14 Thread Joe Ceradini
Hopefully this looks better. I did not realize gmail default was html. I have a dataframe with a column that has many field smashed together. I need to split the strings in the column into separate columns based on patterns. Example of a string that needs to be split: ugly <- c("Water temp:14: F

[R] Split strings based on multiple patterns

2016-10-14 Thread Joe Ceradini
Afternoon, I unfortunately inherited a dataframe with a column that has many fields smashed together. My goal is to split the strings in the column into separate columns based on patterns. Example of what I'm working with: ugly <- c("Water temp:14: F Waterbody type:Permanent Lake/Pond: Water pH:

Re: [R] about data problem

2016-09-20 Thread Joe Ceradini
read.csv("your_data.csv", stringsAsFactors=FALSE) (I'm just reiterating Jianling said...) Joe On Tue, Sep 20, 2016 at 4:56 PM, lily li wrote: > Is there a function in read.csv that I can use to avoid converting numeric > to factor? Thanks a lot. > > > > On Tue, Sep 20, 2016 at 4:42 PM, lily li

Re: [R] gsub: replacing slashes in a string

2016-09-14 Thread Joe Ceradini
Guru > > What is the problem that you are trying to solve? > Tell me what you want to do, not how you want to do it. > > On Wed, Sep 14, 2016 at 12:25 PM, Joe Ceradini > wrote: > >> Hi all, >> >> There are many R help posts out there dealing with slash

Re: [R] gsub: replacing slashes in a string

2016-09-14 Thread Joe Ceradini
> [1] 9 9 9 9 > > write.csv(test2) > "","x" > "1","8/24/2016" > "2","8/24/2016" > "3","6/16/2016" > "4","6/16/2016" > > ----- > David L Carlson > Departm

[R] gsub: replacing slashes in a string

2016-09-14 Thread Joe Ceradini
Hi all, There are many R help posts out there dealing with slashes in gsub. I understand slashes are "escape characters" and thus need to be treated differently, and display differently in R. However, I'm still stuck on find-replace problem, and would appreciate any tips. Thanks! GOAL: replace al

Re: [R] R STUDIO crashing

2016-05-19 Thread Joe Ceradini
Also, this starting happening for me with R studio 0.99.893, so if you have a different version, maybe it is a different issue (or maybe it is a different issue regardless...). Joe On Thu, May 19, 2016 at 7:27 AM, Joe Ceradini wrote: > I had this problem as well, a lot, and it was frustrat

Re: [R] R STUDIO crashing

2016-05-19 Thread Joe Ceradini
I had this problem as well, a lot, and it was frustrating and I did not find much reference to it online. I believe it occurs after you run a plot and then make the plotting window too small for R studio to redraw the plot. Then when run a line of code, it never runs or appears to be running indefi

[R] survival::clogit, how to extract residuals for GOF assessment

2016-04-26 Thread Joe Ceradini
Hi Folks, Hopefully this question has enough R and not too much stats to be appropriate for this list. Based on,* Hosmer et al. 2013. Logistic regression for matched case-control studies. Applied Logistic Regression *(eqtn. 7.8)*, *I am assessing GOF of conditional (or matched) logistic regression

Re: [R] aggregate and the $ operator

2016-01-22 Thread Joe Ceradini
Does this do what you want? aggregate(Nuclei ~ Slide, example, sum) On Fri, Jan 22, 2016 at 12:20 PM, Ed Siefker wrote: > Aggregate does the right thing with column names when passing it > numerical coordinates. > Given a dataframe like this: > > Nuclei Positive Nuclei Slide > 1133

Re: [R] Survival::coxph (clogit), survConcordance vs. summary(fit) concordance

2016-01-21 Thread Joe Ceradini
Thanks Terry! I thought that since I was providing survConcordance with the model object that the same formula would be applied. But I was obviously wrong. I just ran survConcordance with the addition of the strata argument, as you suggested, and got the same answer as summary(fit)with the sam

Re: [R] Survival::coxph (clogit), survConcordance vs. summary(fit) concordance

2016-01-20 Thread Joe Ceradini
r(site), method ="efron", > data = dat) # warning > fit <- clogit(resp ~ x1 + x2 + strata(ID) + cluster(site), method > ="efron", data = dat) # no warning > summary(fit) > > Chris > > -Original Message- > From: Joe Ceradini [mailto:j

[R] Survival::coxph (clogit), survConcordance vs. summary(fit) concordance

2016-01-19 Thread Joe Ceradini
Hi, I'm running conditional logistic regression with survival::clogit. I have "1-1 case-control" data, i.e., there is 1 case and 1 control in each strata. Model: fit <- clogit(resp ~ x1 + x2, strata(ID), cluster(site), method ="efron", data = dat) Where resp is 1's and 0's, and x1 and x2 are both

Re: [R] Missing data in RMark

2015-12-18 Thread Joe Ceradini
Caroline - the phidot forum is an *excellent* spot to post this question. There is an entire RMark subforum. www.phidot.org/forum/index.php Even just searching this forum will probably give you some answers. Also, this book has a whole section on individual covariates and approaches for dealing wi

[R] Universal axis is overwritten in ggplot panel plot using grid.arrange

2015-08-26 Thread Joe Ceradini
R-helpers, I am trying to make a panel of ggplots with universal Y and X axes. There are many examples that show how to do this with grid.arrange. However, my x axis label looks like it is (maybe) overwritten by the margin of the lower left plot and I cannot figure out how to fix it. I realize thi