Re: [R] Current version of R, 4.4.0 and patch to correct the bug fix related to the RStudio viewer pane on Windows systems

2024-05-16 Thread Ben Bolker
tant issue, but I'm not optimistic about that ... Ben Bolker On 2024-05-16 1:38 p.m., CALUM POLWART wrote: Do you receive RDS objects from unknown (untrusted) sources? ?? If not - the security issue is a non-issue as I understand it. On Thu, 16 May 2024, 16:21 Vega, Ann (she/her/hers) via R

Re: [R] Print date on y axis with month, day, and year

2024-05-09 Thread Ben Bolker
gg0 <- ggplot(data=yyy[1:30,],aes(as.Date(jdate,format="%m-%d-%Y"),Sum)) +geom_point() gg0 + scale_x_date(date_labels = "%m/%d/%Y") On 2024-05-09 7:58 p.m., Sorkin, John wrote: I am trying to use ggplot to plot the data, and R code, below. The dates (jdate) are printing as Mar 01, Mar 15,

Re: [R] Get a copy of a matrix only for TRUE entries of a matching size boolean matrix?

2024-05-03 Thread Ben Bolker
In two steps: result <- matrix(NA_character_, nrow=nrow(mat_letters), ncol =ncol(mat_letters)) result[mat_bools] <- mat_letters[mat_bools] On 2024-05-03 8:47 a.m., DynV Montrealer wrote: Is there a way to get a copy of a matrix only for TRUE entries of a matching size boolean matrix? For

Re: [R] x[0]: Can '0' be made an allowed index in R?

2024-04-21 Thread Ben Bolker
Also https://cran.r-project.org/package=Oarray (which is older and hence possibly more stable) On 2024-04-21 3:55 a.m., Hans W wrote: As we all know, in R indices for vectors start with 1, i.e, x[0] is not a correct expression. Some algorithms, e.g. in graph theory or combinatorics, are much

Re: [R] x[0]: Can '0' be made an allowed index in R?

2024-04-21 Thread Ben Bolker
https://cran.r-project.org/package=index0 On Sun, Apr 21, 2024, 3:56 AM Hans W wrote: > As we all know, in R indices for vectors start with 1, i.e, x[0] is not a > correct expression. Some algorithms, e.g. in graph theory or combinatorics, > are much easier to formulate and code if 0 is an

Re: [R] Printout and saved results

2024-03-26 Thread Ben Bolker
Fragile and probably a bad idea, but: "%.%" <- function(x,y) { assign(deparse(substitute(x)), y, parent.frame()); print(y) } > a %.% "hello" [1] "hello" > a [1] "hello" Not sure how much value this has over other idioms such as wrapping the assignment in parentheses, which makes

Re: [R] as.complex()

2024-03-25 Thread Ben Bolker
That's hard to define unambiguously at a mathematical level. What definition did you have in mind? Can you provide more context? (Maybe you want to compare Mod(x) to Mod(y) ?) On 2024-03-25 3:23 a.m., Thomas K wrote: Needing a < , > comparison for imaginary numbers

Re: [R] an issue about subsetting a vector

2024-03-24 Thread Ben Bolker
As with a lot of things in R, the behaviour is counterintuitive but (arguably) logical. The key (maybe) is that `a[-x]` does not mean "take all of the elements of a except those indicated by `x`, but rather, "negate x, then take all but the negative elements". In other words, -integer(0)

Re: [R] Building Packages.

2024-03-21 Thread Ben Bolker
function. Duncan Murdoch On 21/03/2024 4:31 a.m., Martin Maechler wrote: "Duncan Murdoch on Wed, 20 Mar 2024 13:20:12 -0400 writes:   > On 20/03/2024 1:07 p.m., Duncan Murdoch wrote:   >> On 20/03/2024 12:37 p.m., Ben Bolker wrote:   >>> Ivan, c

Re: [R] Building Packages.

2024-03-21 Thread Ben Bolker
::disable() that you'll get back to the original-as-installed version. Even if you have RStudio installed you could change the association in your GUI file browser to open R files in emacs by default ... cheers Ben Bolker On 2024-03-21 4:40 a.m., Martin Maechler wrote: Ben Bolker on Wed

Re: [R] Building Packages.

2024-03-20 Thread Ben Bolker
Hmm, looks platform-specific. Under Linux both RStudio and external R console return a0b52513622c41c11e3ef57c7a485767 for digest::digest(install.packages) On 2024-03-20 1:20 p.m., Duncan Murdoch wrote: On 20/03/2024 1:07 p.m., Duncan Murdoch wrote: On 20/03/2024 12:37 p.m., Ben Bolker

Re: [R] Building Packages.

2024-03-20 Thread Ben Bolker
entical results. I thought at one point this might only refer to the GUI package-installation interface, but you seem to be saying it's the install.packages() function as well. Running an up-to-date RStudio on Linux, FWIW -- maybe weirdness only happens on other OSs? Ben Bolker On 2024

Re: [R] Help

2024-02-22 Thread Ben Bolker
I agree that the posting guide is due for updating. If the mailing list maintainers were willing I think r-consult might not be a terrible idea. I do think the center of gravity has moved to Cross Validated, and it might be minimally sufficient to point people there (or Math Overflow for

Re: [R] Use of geometric mean for geochemical concentrations

2024-01-22 Thread Ben Bolker
I think https://stats.stackexchange.com would be best: r-sig-ecology is pretty quiet these days On 2024-01-22 11:05 a.m., Rich Shepard wrote: On Mon, 22 Jan 2024, Bert Gunter wrote: better posted on r-sig-ecology? -- or maybe even stack exchange? Bert, Okay. Regards, Rich

Re: [R] Strange results : bootrstrp CIs

2024-01-13 Thread Ben Bolker
It took me a little while to figure this out, but: the problem is that if your resampling leaves out any countries (which is very likely), your model applied to the bootstrapped data will have fewer coefficients than your original model. I tried this: cc <- unique(e$Country) func <-

Re: [R] Obtaining a value of pie in a zero inflated model (fm-zinb2)

2024-01-07 Thread Ben Bolker
ed-form solution for zero-inflation models as long as the count and/or structural-zero components depend on covariates? In any case, looking inside zeroinfl() you can see that it calls optim() [using BFGS by default, see ?pscl::zeroinfl.control] cheers Ben Bolker On 2024-01-04 9:38 a.m., Chri

Re: [R] ggplot2: Get the regression line with 95% confidence bands

2023-12-12 Thread Ben Bolker
) + > scale_y_continuous(limits=c(470,500),oob=scales::squish) > # > > > > > > > > > > Le lundi 11 décembre 2023 à 23:38:06 UTC+1, Ben Bolker > a écrit : > > > > > > > > On 2023-12-11 5:27 p.m., Daniel Nordlund wrote: > >

Re: [R] ggplot2: Get the regression line with 95% confidence bands

2023-12-11 Thread Ben Bolker
On 2023-12-11 5:27 p.m., Daniel Nordlund wrote: On 12/10/2023 2:50 PM, Rui Barradas wrote: Às 22:35 de 10/12/2023, varin sacha via R-help escreveu: Dear R-experts, Here below my R code, as my X-axis is "year", I must be missing one or more steps! I am trying to get the regression line

Re: [R] adding "Page X of XX" to PDFs

2023-12-02 Thread Ben Bolker
., Jeff Newmiller via R-help wrote: He clearly stated he was using the pdf() graphics device. On December 2, 2023 10:36:44 AM PST, Ben Bolker wrote: It's still not entirely clear to me what framework you're using to generate the PDF, but if it's rmarkdown/Rnw (Sweave)/Quarto-based, then as far

Re: [R] adding "Page X of XX" to PDFs

2023-12-02 Thread Ben Bolker
It's still not entirely clear to me what framework you're using to generate the PDF, but if it's rmarkdown/Rnw (Sweave)/Quarto-based, then as far as I know all of those frameworks use LaTeX as the last step in the script-to-PDF pipeline, and allow the inclusion of arbitrary LaTeX code, so

Re: [R] Mann Kendall mutation package?

2023-12-01 Thread Ben Bolker
Have you looked at the Kendall package? https://stackoverflow.com/questions/62288340/mann-kendall-in-r (you've cross-posted a version of this question to SO as well: https://stackoverflow.com/questions/77587426/what-is-the-algorithm-for-the-mann-kendall-mutation-test ) Please don't

Re: [R] Code editor for writing R code

2023-11-29 Thread Ben Bolker
Presumably there's nothing stopping you *writing* LaTeX in comments -- do you want a code editor that will render and display the LaTeX as you write? (Or am I misunderstanding something?) Does anyone do classic literate programming *sensu* Knuth any more?

Re: [R] make a lattice dotplot with symbol size proportional to a variable in the plotted dataframe

2023-11-08 Thread Ben Bolker
Non-standard evaluation On 2023-11-08 10:56 a.m., Christopher W. Ryan via R-help wrote: Very helpful, Deepayan, and educational. Thank you. What does NSE stand for? Thanks, Chris Deepayan Sarkar wrote: --Chris Ryan __ R-help@r-project.org

Re: [R] How can I remove my packages from rdrr.io?

2023-11-01 Thread Ben Bolker
There is a github site with an issues list: https://github.com/rdrr-io/rdrr-issues/issues It looks like people have successfully requested removal in the past, e.g. https://github.com/rdrr-io/rdrr-issues/issues/113 On 2023-11-01 9:06 a.m., Kim Emilia wrote: Hello all, I would like to

Re: [R] weights vs. offset (negative binomial regression)

2023-10-31 Thread Ben Bolker
icant effects" is automatically suspicious.) This would be a good question for CrossValidated (https://stats.stackexchange.com), you could try posting it there (I would be interested in the answer!) cheers Ben Bolker On 2023-10-30 8:19 p.m., 유준택 wrote: Dear Mr. Bolker,

Re: [R] weights vs. offset (negative binomial regression)

2023-10-28 Thread Ben Bolker
. In general you should *not* check overdispersion of the raw data (i.e., the *marginal distribution* of the data, you should check overdispersion of a fitted (e.g. Poisson) model, as below. cheers Ben Bolker edata <- data.frame(Catch, Effort, xx1, xx2, xx3) ## graphical exploration libr

Re: [R] Need help to resolve the Error: evaluation nested too deeply: infinite recursion / options(expressions=)? Execution halted

2023-10-26 Thread Ben Bolker
Hmm, I can't replicate (i.e., it works fine for me). What are the results of your sessionInfo() (from a *clean* R session)? == R Under development (unstable) (2023-10-25 r85410) Platform: x86_64-pc-linux-gnu Running under: Pop!_OS 22.04 LTS Matrix products: default BLAS:

Re: [R] running crossvalidation many times MSE for Lasso regression

2023-10-23 Thread Ben Bolker
For what it's worth it looks like spm2 is specifically for *spatial* predictive modeling; presumably its version of CV is doing something spatially aware. I agree that glmnet is old and reliable. One might want to use a tidymodels wrapper to create pipelines where you can more easily

Re: [R] [Tagged] Re: Fwd: r-stats: Geometric Distribution

2023-10-19 Thread Ben Bolker
from yours. You can certainly write your code to do `dgeom(x-1, p)`: in fact, you could write a wrapper my_dgeom <- function(x, ...) dgeom(x-1, ...) so that you never have to think about it again ... cheers Ben Bolker On 2023-10-19 3:20 a.m., Jeff Newmiller via R-help wrote: W

Re: [R] Yamamoto test in BreakPoints package

2023-10-19 Thread Ben Bolker
Maybe contact the package maintainer (maintainer("BreakPoints")) and ask? (Normally I avoid bugging package maintainers if I can, but it seems you've looked everywhere else you can ...) Ben Bolker On 2023-10-19 4:18 a.m., Richard O'Keefe wrote: Visit the page at CRAN http

Re: [R] Best way to test for numeric digits?

2023-10-18 Thread Ben Bolker
There are some answers on Stack Overflow: https://stackoverflow.com/questions/14984989/how-to-avoid-warning-when-introducing-nas-by-coercion On 2023-10-18 10:59 a.m., Leonard Mada via R-help wrote: Dear List members, What is the best way to test for numeric digits?

Re: [R] if-else that returns vector

2023-10-12 Thread Ben Bolker
how about if(T) c(1,2,3) else c(5,6) ? On 2023-10-12 4:22 p.m., Christofer Bogaso wrote: Hi, Following expression returns only the first element ifelse(T, c(1,2,3), c(5,6)) However I am looking for some one-liner expression like above which will return the entire vector. Is there any way

Re: [R] Linear discriminant analysis

2023-10-12 Thread Ben Bolker
It's possible that neither of these will help, but (1) you can look at the source code of the predict method (MASS:::predict.lda) (2) you can look at the source reference ("Modern Applied Statistics in S", Venables and Ripley) to see if it gives more information (although it might not);

Re: [R] R issue / No buffer space available

2023-10-05 Thread Ben Bolker
This looks like an RStudio issue; it might be better to post the question on their forum On Thu, Oct 5, 2023, 7:43 AM Ohad Oren, MD wrote: > Hello, > > I keep getting the following message about 'no buffer space available'. I > am using R studio via connection to server. I verified that the

Re: [R] download.file strict certificate revocation check

2023-10-04 Thread Ben Bolker
4 51.0 4 2023-10-03 plotrix 3,082310 of 18,024 98.3 5 2023-10-03 prettyR90 1,954 of 18,024 89.1 It seems that at least plotrix and prettyR would be worth rescuing ... volunteers ... ? (prettyR has 1 strong reverse dep, plotrix has many ...) Ben Bolk

Re: [R] Question about R software and output

2023-10-03 Thread Ben Bolker
It's conceivable that functions in a contributed package would communicate/transmit or receive data from a remote server, but base R does nothing like that (unless you explicitly ask it to). cheers Ben Bolker On 2023-10-02 3:48 a.m., Ferguson Charity (CEMINFERGUSON) wrote: To whom

Re: [R] replace character by numeric value

2023-09-29 Thread Ben Bolker
The reason you're getting the result as character is that you have 'side' as your alternative result in the second ifelse(). If "BUY" and "SELL" are the only options you might try ifelse(side == 'BUY', 1, ifelse(side == 'SELL', -1, NA)) or c(1,-1)[match(side, c("BUY", "SELL"))] or

Re: [R] Odd result

2023-09-24 Thread Ben Bolker
For what it's worth the janitor::remove_empty() (which removes all-NA rows by default, can be set to remove columns instead) can be useful for this kind of cleanup. On 2023-09-24 5:58 a.m., Michael Dewey wrote: Dear David To get the first 46 rows just do KurtzData[1:43,] However really

Re: [R] Theta from negative binomial regression and power_NegativeBinomiial from PASSED

2023-09-15 Thread Ben Bolker
Yes, theta is the 'size' or overdispersion parameter. Sometimes also denoted as k. Wikipedia discusses this parameterization in the paragraph starting "In negative binomial regression ..." (but they call this parameter r rather than theta or k). You can also see this in MASS on google

Re: [R] graph in R with grouping letters from the turkey test with agricolae package

2023-09-13 Thread Ben Bolker
As a side note, I'm curious how often "Tukey test" is misspelled as "Turkey test". Googling '"turkey test" mean comparison' gives 36.1K results (vs 14.3M for '"tukey test" mean comparison" ... On 2023-09-13 10:02 a.m., Richard O'Keefe wrote: d <- read.table("data.txt", TRUE) cor(d[,

Re: [R] Query on finding root

2023-08-28 Thread Ben Bolker
(I mean pdavies) On Mon, Aug 28, 2023, 7:52 AM Ben Bolker wrote: > I would probably use the built in qdavies() function... > > On Mon, Aug 28, 2023, 7:48 AM Leonard Mada via R-help < > r-help@r-project.org> wrote: > >> Dear R-Users, >> >> Just out

Re: [R] Query on finding root

2023-08-28 Thread Ben Bolker
I would probably use the built in qdavies() function... On Mon, Aug 28, 2023, 7:48 AM Leonard Mada via R-help wrote: > Dear R-Users, > > Just out of curiosity: > Which of the 2 methods is the better one? > > The results seem to differ slightly. > > > fun =

Re: [R] Query on finding root

2023-08-27 Thread Ben Bolker
This doesn't look like homework to me -- too specific. The posting guide says that the list is not intended for "Basic statistics and classroom homework" -- again, this doesn't seem to fall into that category. tl;dr, I think the difference

Re: [R] Interpreting Results from LOF.test() from qpcR package

2023-08-20 Thread Ben Bolker
The p-values are non-significant by any standard cutoff (e.g. p<=0.05, p<=0.1) but note that this is a *lack-of-fit* test -- i.e., "does my function fit the data well enough?", **not** a "significant pattern" test (e.g., "does my function fit the data better than a reasonable null model?").

Re: [R] Issues when trying to fit a nonlinear regression model

2023-08-20 Thread Ben Bolker
I haven't looked to see whether you or Bert made an algebraic mistake in translating the parameters of the log-linear model to their equivalents for the nonlinear model, but nls() gives me the same answer as nls() in this case (I called my data 'dd2'): n1 <- nlxb(y~theta1 -

Re: [R] Issues when trying to fit a nonlinear regression model

2023-08-20 Thread Ben Bolker
My answer is WAY longer than Bert Gunter's but maybe useful nonetheless. (Q for John Nash: why does the coef() method for nlmrt objects return the coefficient vector **invisibly**? That seems confusing!) Here's what I did: * as a preliminary step, adjust the formula so that I don't

Re: [R] Determining Starting Values for Model Parameters in Nonlinear Regression

2023-08-19 Thread Ben Bolker
Adding one more method: glm(y~ x1 + x2 + x3 - 1, family = gaussian(link = "inverse"), data = mydata) will fit the exact model (including the desired error structure). The default GLM starting values usually work OK, but it is true that inverse-links can sometimes be more finicky than more

Re: [R] MASS::mvrnorm() on MKL may produce different numbers even when the seed is the same?

2023-08-17 Thread Ben Bolker
Thanks, I was missing the point that this was *non-repeatability on the same platform*. On 2023-08-17 10:31 a.m., Bill Dunlap wrote: MKL's results can depend on the number of threads running and perhaps other things. They blame it on the non-associativity of floating point arithmetic. This

Re: [R] MASS::mvrnorm() on MKL may produce different numbers even when the seed is the same?

2023-08-17 Thread Ben Bolker
> However, should the numbers > generated identical if the same seed is used? I don't see how using the same seed can overcome floating-point differences across platforms (compilers etc.) stemming from differences in an eigen() computation (based on arcane details like use of registers,

Re: [R] X11 font

2023-08-16 Thread Ben Bolker
There's an ancient related question ... maybe it helps? https://stat.ethz.ch/pipermail/r-help//2016-October/442326.html sudo apt-get install xfonts-100dpi sudo-apt-get install xfonts-75dpi apt-cache search xfonts doesn't pull up anything else obvious (presumably you already have xfonts-base

Re: [R] Noisy objective functions

2023-08-13 Thread Ben Bolker
This is a huge topic. Differential evolution (DEoptim package) would be one good starting point; there is a simulated annealing method built into optim() (method = "SANN") but it usually requires significant tuning. Also genetic algorithms. You could look at the NLopt list of

Re: [R] group consecutive dates in a row

2023-08-07 Thread Ben Bolker
rle(as.numeric(diff(mydf$data_POSIX))) should get you started, I think? On 2023-08-07 12:41 p.m., Stefano Sofia wrote: Dear R users, I have a data frame with a single column of POSIXct elements, like mydf <- data.frame(data_POSIX=as.POSIXct(c("2012-02-05", "2012-02-06", "2012-02-07",

Re: [R] Plotting Fitted vs Observed Values in Logistic Regression Model

2023-08-01 Thread Ben Bolker
logistic_regmod2 <- glm(formula = ratio~x, family = binomial(logit), data = random_mod12_data2, weights =n) plot(ratio ~ x, data = random_mod12_data2) pframe <- data.frame(x = sort(random_mod12_data2$x)) pframe$ratio <- predict(logistic_regmod2, newdata = pframe, type = "response")

Re: [R] Downloading a directory of text files into R

2023-07-25 Thread Ben Bolker
Where is readtext() from? Some combination of scraping http://home.brisnet.org.au/~bgreen/Data/Hanson1/ and http://home.brisnet.org.au/~bgreen/Data/Hanson2/ to recover the required file names: library(rvest) read_html("http://home.brisnet.org.au/~bgreen/Data/Hanson1/;) |>

Re: [R] col2rgb() function

2023-07-23 Thread Ben Bolker
Stevens, PhD, PE, Professor Civil and Environmental Engineering Utah Water Research Laboratory Utah State University 8200 Old Main Hill Logan, UT 84322-8200 david.stev...@usu.edu (435) 797-3229 (office) On 7/23/2023 1:00 PM, Nick Wray wrote: Thanks That works nicely Nick On Sun, 23 Jul 2023 at 19:2

Re: [R] col2rgb() function

2023-07-23 Thread Ben Bolker
Does adjustcolor() help? cb8<- c("#00", "#E69F00", "#56B4E9", "#009E73","#F0E442", "#0072B2", "#D55E00", "#CC79A7") plot(0,0,xlim=c(1,8),ylim=c(0,1)) points(1:8,rep(0.5,8),col=cb8,pch=19,cex=2) points(1:8,rep(0.75,8),col=adjustcolor(cb8, alpha.f = 0.3), pch=19,cex=2) On 2023-07-23 2:15

Re: [R] glmmPQL crashes on inclusion of corSpatial object

2016-07-25 Thread Ben Bolker
e of answerers who don't know the question has been commented on and/or answered already elsewhere). Try to pick the single best venue and stick to it. Ben Bolker __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.et

Re: [R] glmmLasso with interactions errors

2016-07-15 Thread Ben Bolker
Cade, Brian usgs.gov> writes: > > It has never been obvious to me that the lasso approach can handle > interactions among predictor variables well at all. > I'ld be curious to see > what others think and what you learn. > > Brian > For what it's worth I think lasso *does* handle

Re: [R] dependent p.values in R

2016-07-10 Thread Ben Bolker
r normality are misguided. Combining p-values from different tests feels like compounding the issue. In any case, I would definitely say that this a question for CrossValidated (http://stats.stackexchange.com), rather than r-help ... Ben Bolker

Re: [R] Fixed Effects in lme function

2016-07-09 Thread Ben Bolker
li li gmail.com> writes: > > Dear all, > For the data below, I would like to fit a model with common > random slope and common random intercept as shown below. I am > interested in obtaining separate fixed effect estimates (intercept > and slope and corresponding hypothesis test) for each

Re: [R] Effect size measures for GLM

2016-06-24 Thread Ben Bolker
Gianfranco Lovison unipa.it> writes: > > Is there a library for (friendly) calculation of effect size measures for > Generalized Linear Models? I have found "compute.es", but it seems to be > suitable only for Linear Models. A library taking a glm object and > computing > partial R^2-type

Re: [R] model specification using lme

2016-05-29 Thread Ben Bolker
t you're reposting) cheers Ben Bolker __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide comm

Re: [R] code to provoke a crash running rterm.exe on windows

2016-05-28 Thread Ben Bolker
a bug report, *or* open a discussion on r-de...@r-project.org (which I'd have said was a more appropriate venue for this question in any case) ... Ben Bolker __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/l

Re: [R] error in lmerTest after updating to R 3.3.0

2016-05-10 Thread Ben Bolker
Pascal A. Niklaus ieu.uzh.ch> writes: > > Dear all, > > After updating to R 3.3.0 (inadvertently, via apt-get), I get an error > when using lmerTest. Here is an example: > > library(lmerTest) > library(MASS) > data(oats) > m <- lmer(Y ~ N*V + (1|B/V), data=oats) > summary(m) > > summary

Re: [R] Coverage Probability

2016-05-10 Thread Ben Bolker
Muhammad Kashif uaf.edu.pk> writes: > > Dears > Can anyone help me to solve the issue. > > By using" boot" and "boot.ci" package in R we can construct bootstrap confidence intervals. How we > calculate the coverage probability of these intervals. Calculating coverage probability for any

Re: [R] Regarding to R

2016-05-10 Thread Ben Bolker
l will depend on your background; your field/desired type of analyses; language; personality; etc. etc.. There are literally thousands of R tutorials and books, many available for free on the internet. I'd suggest you google "learning R programming", inspect a dozen or so of the top hits, and

Re: [R] How to solve an NLME problem?

2016-03-29 Thread Ben Bolker
David C Blouin lsu.edu> writes: > I have a nonlinear model where I want to include random > coefficients for a sample of random SUBJECTS. The fixed effects part > of the model is Y ~ B + (T - B) / (1 + 10**(X - C)) and I would like > to include random coefficients b for B, t for T, and c for C.

Re: [R] Regression with factor having1 level

2016-03-10 Thread Ben Bolker
Robert McGehee gmail.com> writes: > > Hello R-helpers, > I'd like a function that given an arbitrary formula and a data frame > returns the residual of the dependent variable, and maintains all > NA values. > > Here's an example that will give me what I want if my formula is y~x1+x2+x3 > and

Re: [R] Ruofei Mo - How can I generate correlated data with non-normal distribution?

2016-03-02 Thread Ben Bolker
Ruofei Mo【莫若飞】 <911mruofei tongji.edu.cn> writes: > > Hi, All, > > I have a question about how to generate correlated data with non-normal > distribution? Basic, I have a variable a that follows a normal distribution, > a ~ N(0,1), then I want to generate another variable b that follows a >

Re: [R] MCMCglmm and iteration

2016-02-16 Thread Ben Bolker
Rémi Lesmerises yahoo.ca> writes: > Hi everyone, I'm running a bayesian regression using the package > MCMCglmm (Hadfield 2010) and to reach a normal posterior > distribution of estimates, I increased the number of iteration as > well as the burnin threshold. However, it had unexpected >

Re: [R] installing tikzDevices for R 3.2.3

2016-01-16 Thread Ben Bolker
Ranjan Maitra inbox.com> writes: > > On Fri, 15 Jan 2016 21:25:06 -0600 Ranjan Maitra inbox.com> wrote: > > > Hi, > > > > I wanted to install tikzDevices on a installation of > R (3.2.3) on a new machine. However, I am getting: > > > > > install.packages('tikzDevices') > > > > Warning

Re: [R] Find Crossover Points of Two Spline Functions

2015-09-28 Thread Ben Bolker
Dario Strbenac uni.sydney.edu.au> writes: > > Good day, > > I have two probability densities, each with a function determined > by splinefun(densityResult[['x']], > densityResult[['y']], "natural"), where densityResult is the > output of the density function in stats. > How can I determine all

Re: [R] Find Crossover Points of Two Spline Functions

2015-09-28 Thread Ben Bolker
Bert Gunter gmail.com> writes: > > Use ?uniroot to do it numerically instead of polyroot()? > > Cheers, > Bert > Bert Gunter The problem with uniroot() is that we don't know how many intersections/ roots we might be looking for. With polyroot(), we know that there can be at most 3 roots

Re: [R] Accessing defunct package

2015-09-25 Thread Ben Bolker
Dennis Fisher plessthan.com> writes: > Colleagues, > > In the past, I used a package: > SASxport > to output files to SAS’s XPT format. This was useful because FDA requests that data be submitted in that > format (even though they typically must reconvert to some other format before the

Re: [R] maximum-likelihood-estimation with mle()

2015-09-12 Thread Ben Bolker
peter dalgaard gmail.com> writes: > > You are being over-optimistic with your starting values, and/or > with constrains on the parameter space. > Your fit is diverging in sigma for some reason known > only to nonlinear-optimizer gurus... > > For me, it works either to put in an explicit >

Re: [R] urgent question about Lmer models

2015-09-03 Thread Ben Bolker
e original poster) *please don't cross-post to R lists and StackOverflow*; it causes wasted effort, as in this case. Ben Bolker __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do r

Re: [R] equivalent of repeated measures anova using lmer

2015-08-20 Thread Ben Bolker
asudar aruna.sudarshan at gmail.com writes: I am trying to run a linear mixed effects model similar to the 2*2*2 anova design. My DV is reaction time and fixed factors are time (pre vs. post:within-subject), condition (congruent vs. incongruent: within subject) and stimulation (vertex vs.

Re: [R] Jaccard index

2015-08-14 Thread Ben Bolker
sreenath sreenath.rajur at macfast.ac.in writes: sim(file_name,method=jaccard) this command is giving the raw wise similarity matrix how can i find column wise similarity matrix? what is the command? please help me Based on a search library(sos); findFn(jaccard sim) I'm guessing

Re: [R] Predict Function use with GLM

2015-08-12 Thread Ben Bolker
trisgutt trisgutt at hotmail.com writes: I am currently using a GLM with Gaussian family to model fish depth~length + distance from shore: model1 - glm(Depth ~ length + distance from shore, family=gaussian(link=log)) There are no zero depths. I would like to use the above model with

Re: [R] Error with predict and newdata

2015-08-08 Thread Ben Bolker
David Winsemius dwinsemius at comcast.net writes: On Aug 7, 2015, at 2:41 PM, kira taylor wrote: Hi! I am trying to use predict to apply my model to data from one time period to see what might be the values for another time period. I did this successfully for one dataset, and

Re: [R] help plotting glmm values

2015-08-07 Thread Ben Bolker
Luis Fernando García luysgarcia at gmail.com writes: Dear Fellows, I´m sorry if my question is very basic, but I'm still new in the field of R and the GLMM. In future, you might consider posting to r-sig-mixed-mod...@r-project.org instead ... I have made a following glmm, and I need

Re: [R] Contr.sum and coefficient tests

2015-07-23 Thread Ben Bolker
François Collin stxfc at nottingham.ac.uk writes: Dear all, I would like to run a linear model which includes two factors: - The first one has two levels, including a reference level. Thus I have to use the treatment contrast (contr.treatment, reference level effect = 0, then the

Re: [R] Statistical distribution not fitting

2015-07-23 Thread Ben Bolker
suggestions how ...) cheers Ben Bolker __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

Re: [R] Statistical distribution not fitting

2015-07-22 Thread Ben Bolker
Amelia Marsh amelia_marsh08 at yahoo.com writes: Hello! (I dont know if I can raise this query here on this forum, but I had already raised on teh finance forum, but have not received any sugegstion, so now raising on this list. Sorry for the same. The query is about what to do, if no

Re: [R] glm help - final predictor variable NA

2015-07-22 Thread Ben Bolker
matthewjones43 matthew.jones at kellogg.ox.ac.uk writes: Hi, I am not a statistician and so I am sure whatever it is I am doing wrong must be an obvious error for those who are...Basically I can not understand why I get NA for variable 'CDSTotal' when running a glm? Does anyone have an

Re: [R] Why does dredge() rank models differently for lmer() and MCMCglmm()?

2015-07-18 Thread Ben Bolker
Corina itsme at CorinaLogan.com writes: Hello, I am running my full model (fm) through lmer() and MCMCglmm() using the default settings: model.lmer - lmer(fm) model.MCMCglmm - MCMCglmm(fm) [snip] However, when I run the models through dredge(): dredge(model.lmer)

Re: [R] A question about nlmer in lme4 package

2015-07-11 Thread Ben Bolker
, see e.g. http://stackoverflow.com/questions/15141952/nlmer-longitudinal-data http://rpubs.com/bbolker/3423 Ben Bolker __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Hypergeometric Function seems to give wrong results

2015-07-08 Thread Ben Bolker
mailing list (indicating that you've already tried here). good luck Ben Bolker __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] Cross-over Data with Kenward-Roger correction

2015-06-09 Thread Ben Bolker
knouri nouri4 at yahoo.com writes: Dear all:for the folowing data, a two-period, two treatment (A=1 vs. B=2) cross-over is fitted using the folowing SAS code.  data one; [snip] run; proc mixed data=one method=reml; class Sbj Per Trt;    model PEF = Per Trt /ddfm=kr;    repeated Trt

Re: [R] Different random intercepts but same random slope for groups

2015-06-09 Thread Ben Bolker
. However, there seems to be some problem. Any suggestions? Please do not cross-post to more than one R list (in this case, r-sig-mixed-models is more appropriate, and you've already gotten some answers there). Ben Bolker __ R-help@r-project.org

Re: [R] Why I am not able to load library(R.matlab)? Other packages are fine.

2015-05-29 Thread Ben Bolker
C W tmrsg11 at gmail.com writes: Hi Henrik, I don't quite get what I should do here. I am not familiar with R.methodS3. Can you tell me what command exactly do I need to do? Thanks, Mike install.packages(R.methodsS3) install.packages(R.matlab) library(R.matlab) [snip snip

Re: [R] Why I am not able to load library(R.matlab)? Other packages are fine.

2015-05-29 Thread Ben Bolker
was using R.matlab few weeks ago. I believe I was on R 3.1. Maybe it's in R 3.1 folder? I am using a Mac, btw. Cheers, -M On Fri, May 29, 2015 at 1:55 PM, Ben Bolker bbol...@gmail.com wrote: C W tmrsg11 at gmail.com writes: Hi Henrik, I don't quite get what I should do

Re: [R] [R-sig-ME] different results from lme and lmer function

2015-05-26 Thread Ben Bolker
These actually aren't terribly different from each other. I suspect that lmer is slightly closer to the correct answer, because lme reports a log-likelihood (really -1/2 times the REML criterion) of 49.30021, while lmer reports a REML criterion of -98.8 - slightly better fit at -R/2 = 49.4.

Re: [R] lme function to obtain pvalue for fixed effect

2015-05-26 Thread Ben Bolker
-posting is considered to be impolite). r-sig-mixed-models seems to be more appropriate for these questions. sincerely Ben Bolker __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] Cannot run install binary package on Windows 8

2015-04-11 Thread Ben Bolker
Maciej Węgorkiewicz wegorkie at gmail.com writes: Hi all, I am just starting with R and cannot use lmtest package on Windows 8. This package contains dwtest function that I am interested in. I began with installing the core of R (with rgui) - version 3.1.3 64-bit. Then I installed

Re: [R] Question on CCA and RDA analysis

2015-04-10 Thread Ben Bolker
Luis Fernando García luysgarcia at gmail.com writes: Dear R experts, I wanted to know if you can suggest me any website or tutorial just to learn about how to make a RDA or CDA in R Thanks in advance! I hate to ask, but did you try Googling canonical correspondence analysis R ...

Re: [R] Package build system adds line break in DESCRIPTION URL

2015-04-03 Thread Ben Bolker
-building process. Two thoughts: (1) as a workaround, could you use a URL-shortener such as tinyurl? tinyurl allows you to specify a somewhat meaningful name for the shortened URL, e.g. http://tinyurl.com/reproducible-000 (2) this feels like it is more suitable for r-de...@r-project.org Ben Bolker

Re: [R] temporal autocorrelation in MCMCglmm

2015-03-30 Thread Ben Bolker
the ACF() method (not the same thing as acf()) on the resulting model fit. Ben Bolker __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] Error in lm() with very small (close to zero) regressor

2015-03-29 Thread Ben Bolker
RiGui raluca.gui at business.uzh.ch writes: [snip] I am terribly sorry for the code not being reproducible, is the first time I am posting here, I run the code several times before I posted, but...I forgot about the library used. Thanks for updating. To answer to your questions:

Re: [R] Help w/ variable names in loop with lmer

2015-03-29 Thread Ben Bolker
David Crow david.crow at cide.edu writes: Hi, R users- I'm estimating random effects models with cross-level interactions; I want to interact each of a vector of level-1 variables with each of a vector of level-2 variables. Here's the code: #create data frame

  1   2   3   4   5   6   7   8   9   10   >