Re: [R] How to stratify data with multiple group simultaneously with R ggplot2?

2025-06-08 Thread Jeff Newmiller via R-help
aes(x=x, y=y, colour=w, group=w)) + > geom_line(linewidth=2) + > ggtitle("A+B") >ggplot(df[df$z=="A",], aes(x=x, y=y, colour=w, group=w)) + > geom_line(linewidth=2) + > ggtitle("A") >ggplot(df[df$z=="B",], aes(x=x, y=y, colour=w, group=w

[R] Repository of Examples and Problems from Lock5 textbook

2025-06-01 Thread Kevin Zembower via R-help
answers against those given in the book for almost all the problems. Let me know if you think this repository could be improved in any way. Thank you to all the folks who helped me better understand statistics and how to compute them with R. -Kevin ______

Re: [R] Simulating mid-points from a defined range

2025-05-31 Thread JRG via R-help
M Brian Smith briansmith199...@gmail.com >>> wrote: >>> >>> > Hi, >>> > >>> > Let say I have a range [0, 100] >>> > >>> > Now I need to simulate 1000 10 mid-points within the range with >>> > accuracy upto

Re: [R] Simulating mid-points from a defined range

2025-05-31 Thread JRG via R-help
ence between any 2 > > consecutive mid-points shall be at-least 5.00. > > > > I wonder if there is any Statistical theory available to support this > > kind of simulation. > > > > Alternately, is there any way in R to implement this? > > > > _

Re: [R] Simulating mid-points from a defined range

2025-05-31 Thread Jeff Newmiller via R-help
t; >> I wonder if there is any Statistical theory available to support this >> kind of simulation. >> >> Alternately, is there any way in R to implement this? >> >> __ >> R-help@r-project.org mailing list -- To UNSUBSCR

Re: [R] Failed to convert text to date

2025-05-31 Thread Jeff Newmiller via R-help
Could you please help why I am getting NA value? > >__ >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 https://www.R-project.org/posting-guide.html >and provide

Re: [R] constructing a matrix for rgl plots

2025-05-31 Thread Jeff Newmiller via R-help
ould still have your x and y partition variables from when you created the data frame, and you should be able to construct the matrix using the matrix() constructor (not the as.matrix function) from your data frame z column. ?matrix On May 31, 2025 4:04:20 AM PDT, ravi via R-help wrote: >H

[R] constructing a matrix for rgl plots

2025-05-31 Thread ravi via R-help
phi = 20) :   At least one coordinate must be a matrix  How do I get z in the form of a matrix? Thanks. __ 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

Re: [R] Need r help asap

2025-05-30 Thread Jeff Newmiller via R-help
desperate to get it back. > >Hannah >Sent from my iPhone >__ >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 https://www.R-project.

Re: [R] Looking for a function or a set of steps

2025-05-29 Thread Mike Day via R-help
gt; Paul Zachos, PhD >> Director, Research and Evaluation >> Association for the Cooperative Advancement of Science and Education >> (ACASE) >> 110 Spring Street Saratoga Springs, NY 12866 | >> p...@acase.org | www.acase.org >> >> >> >&g

[R] Only one label from axis() is shown

2025-05-28 Thread Marc Girondot via R-help
or  4 minor  5.0 year   2025 month  05 day    16 svn rev    88216 language   R version.string R version 4.5.0 Patched (2025-05-16 r88216) nickname   How About a Twenty-Six ----

Re: [R] how to read a PSB file in R?

2025-05-27 Thread Ranjan Maitra via R-help
On Tue May20'25 12:15:41AM, Ranjan Maitra via R-help wrote: > From: Ranjan Maitra via R-help > Date: Tue, 20 May 2025 00:15:41 -0500 > To: r-help@r-project.org > Reply-To: Ranjan Maitra > Subject: Re: [R] how to read a PSB file in R? > > On Tue May20'25 05:56:59A

Re: [R] how to read a PSB file in R?

2025-05-26 Thread Ranjan Maitra via R-help
On Tue May20'25 12:15:41AM, Ranjan Maitra via R-help wrote: > From: Ranjan Maitra via R-help > Date: Tue, 20 May 2025 00:15:41 -0500 > To: r-help@r-project.org > Reply-To: Ranjan Maitra > Subject: Re: [R] how to read a PSB file in R? > > On Tue May20'25 05:56:59A

Re: [R] Looking for a function or a set of steps

2025-05-26 Thread paul zachos via R-help
t; 1-x > >> On 18.05.2025, at 19:40, paul zachos via R-help wrote: >> >> Dear R Community >> >> I am an R beginner >> >> I have a vector of ‘1’s and ‘0’s >> >> x >> [1] 0 0 1 0 0 1 1 0 1 0 1 1 1 0 1 1 0 0 1 0 1 0 1 0 0 0 0 >> [28] 0

Re: [R] Formatting zeroes with prettyNum

2025-05-23 Thread Marttila Mikko via R-help
(In hindsight I should have used a `zero.print` value that looked less like a typo, e.g. `zero.print = "--"` in my example. Sorry about the potential confusion.) -Original Message----- From: R-help On Behalf Of Marttila Mikko via R-help Sent: Friday, 23 May 2025 13:21 To: How

Re: [R] Formatting zeroes with prettyNum

2025-05-23 Thread Marttila Mikko via R-help
place = TRUE) [1] " " Warning message: In .format.zeros(x, zero.print, replace = replace.zero) : 'zero.print' is truncated to fit into formatted zeros; consider 'replace=TRUE' When zero.print is only one character, it doesn't give a warning. Tim >

Re: [R] Formatting zeroes with prettyNum

2025-05-23 Thread Howard, Tim G (DEC) via R-help
zero.print = " - ", replace = TRUE) [1] " " Warning message: In .format.zeros(x, zero.print, replace = replace.zero) : 'zero.print' is truncated to fit into formatted zeros; consider 'replace=TRUE' When zero.print is only one character, it doesn'

[R] Formatting zeroes with prettyNum

2025-05-23 Thread Marttila Mikko via R-help
ribution, or reliance upon the contents of this e-mail is strictly prohibited. If you have received this e-mail transmission in error, please reply to the sender, so that they can arrange for proper delivery, and then please delete the message from your computer systems. Thank you.

Re: [R] Why is there no macro facility for R?

2025-05-22 Thread Marc Schwartz via R-help
mericans Independence Center; >> Senior Statistician University of Maryland Center for Vascular Research; >> >> Division of Gerontology and Paliative Care, >> 10 North Greene Street >> GRECC (BT/18/GR) >> Baltimore, MD 21201-1524 >> Cell phone 443-418

Re: [R] Looking for a function or a set of steps

2025-05-19 Thread Goodale, Tom via R-help
Surely doing y <- 1 - x would be the simplest way? Best, Tom > -Original Message- > From: R-help On Behalf Of Rui Barradas > Sent: 19 May 2025 08:08 > To: paul zachos ; r-help@r-project.org > Subject: Re: [R] Looking for a function or a set of steps > > Às 1

Re: [R] how to read a PSB file in R?

2025-05-19 Thread Ranjan Maitra via R-help
On Tue May20'25 05:56:59AM, Rui Barradas wrote: > From: Rui Barradas > Date: Tue, 20 May 2025 05:56:59 +0100 > To: Ranjan Maitra , r-help@r-project.org > Subject: Re: [R] how to read a PSB file in R? > > Às 03:17 de 20/05/2025, Ranjan Maitra via R-help escreveu: > >

[R] how to read a PSB file in R?

2025-05-19 Thread Ranjan Maitra via R-help
file. Many thanks and best wishes, Ranjan __ 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 https://www.R-project.org/posting-guide.html and provide commented

[R] Very odd issue getting "Input/output error" running shiny app from index.html locally but same shiny on my server working fine

2025-05-19 Thread Chris Evans via R-help
<https://www.coresystemtrust.org.uk/> Other work web site: https://www.psyctc.org/psyctc/ Personal site: https://www.psyctc.org/pelerinage2016/ <https://ombook.psyctc.org/book> __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see http

Re: [R] Very odd issue getting "Input/output error" running shiny app from index.html locally but same shiny on my server working fine

2025-05-19 Thread Chris Evans via R-help
and then in a browser I enter the URL http://localhost:8787/ HTH, Eric On Mon, May 19, 2025 at 6:01 PM Chris Evans via R-help wrote: I realise that shiny and Rstudio is often seen as OT here but I have a strong suspicion that the issue is R or R/OS related so

[R] Looking for a function or a set of steps

2025-05-18 Thread paul zachos via R-help
like to generate a new vector in which the ‘1’s in x become ‘0’s and the ‘0’s in x become ‘1’s. How should I go about this? Thank you, paz __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] customizing library locations for R in ubuntu

2025-05-15 Thread ravi via R-help
lbuettel wrote: On 9 May 2025 at 16:41, Ivan Krylov via R-help wrote: | This is not guaranteed to work, especially for (but not limited to) | packages that compile source code and link to various interfaces inside | R: https://stat.ethz.ch/pipermail/r-help/2025-April/480832.html | | This problem

Re: [R] customizing library locations for R in ubuntu

2025-05-15 Thread ravi via R-help
on the terminal? What is a simple test to determine that I have the r2u up and running? Thanks, Ravi On Wednesday, 14 May 2025 at 13:53:26 CEST, Dirk Eddelbuettel wrote: On 9 May 2025 at 16:41, Ivan Krylov via R-help wrote: | This is not guaranteed to work, especially for (but not limite

[R] Different output type with as.Date

2025-05-15 Thread Barthelemy Tanguy via R-help
Date(0L, origin = "1970-01-01") |> typeof() #> [1] "double" ``` Is it a bug or the intended behaviour? I don't see any mention of this in the documentation. I'm working on R 4.5 Thank you! Tanguy BARTHELEMY __ R-h

Re: [R] customizing library locations for R in ubuntu

2025-05-14 Thread ravi via R-help
Thanks to Jeff and Ivan for your helpful comments. Ravi On Saturday, 10 May 2025 at 11:37:29 CEST, Ivan Krylov wrote: В Thu, 8 May 2025 19:39:40 + (UTC) ravi via R-help пишет: > In windows, I add the following line: > .libPaths(c(“C:/Rownlib”,”C:/R/R-4.5.0/library”)) >    

Re: [R] missing value where TRUE/FALSE needed with R ipolygrowth

2025-05-09 Thread Jeff Newmiller via R-help
ative numbers into powers or log or sqrt... kind of things. Read the documentation for your analysis packages carefully. On May 9, 2025 2:31:29 AM PDT, Luigi Marongiu wrote: >Dear R-Help, >I am trying to determine the growth rate of bacteria under specific >conditions using >ipo

Re: [R] customizing library locations for R in ubuntu

2025-05-09 Thread Ivan Krylov via R-help
В Thu, 8 May 2025 19:39:40 + (UTC) ravi via R-help пишет: > In windows, I add the following line: > .libPaths(c(“C:/Rownlib”,”C:/R/R-4.5.0/library”)) >   in the file C:/R/R-4.5.0/etc/Rprofile.site > > I have my own list of packages in the Rownlib folder and the packages &

Re: [R] empty `Rscript -e "Rcpp:::LdFlags()"` prevents installation

2025-05-09 Thread Ralf Goertz via R-help
ive())" and the problem is gone. The reason the "$()" variant worked is probably due to some subtle differences between the two. <https://mywiki.wooledge.org/BashFAQ/082> ______ R-help@r-project.org mailing list -- To UNSUBSCRIBE and m

[R] empty `Rscript -e "Rcpp:::LdFlags()"` prevents installation

2025-05-09 Thread Ralf Goertz via R-help
27;s guidelines should address this? __ 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 https://www.R-project.org/posting-guide.html and provide commented, mi

Re: [R] customizing library locations for R in ubuntu

2025-05-08 Thread Jeff Newmiller via R-help
s the packages that are "built-in" to R. On May 8, 2025 12:39:40 PM PDT, ravi via R-help wrote: >Hi, >In Windows, I follow a method with customized library locations that has >worked for me when upgrading to new R versions.  I have not been able to >follow the same method in U

[R] customizing library locations for R in ubuntu

2025-05-08 Thread ravi via R-help
d also appreciate explanations for why the library system in ubuntu is structured in the way it is. Thanks, Ravi __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the po

Re: [R] Help merging large datasets in R

2025-05-08 Thread Jeff Newmiller via R-help
g does not corrupt your code example. On May 6, 2025 11:53:42 PM PDT, "Deelen, M. (Mirjam) via R-help" wrote: >Hi guys, >For my MSc. thesis i am using R studio. The goal is for me to merge a couple >(6) of relatively large datasets (min of 200.000 and max of 2mil rows). I

Re: [R] Help merging large datasets in R

2025-05-07 Thread Jeff Newmiller via R-help
set. Try merging that where it is easy to check. Then expand to using all >the data. Your approach should work with a little modification. Alternatively >make a couple of small fake data sets and play with those. Once you have the >code correct there should be no problem expanding to the

[R] Help merging large datasets in R

2025-05-07 Thread Deelen, M. (Mirjam) via R-help
(so I can drop the additonal criteria and the final amount of cases, probably, increases). * Or are there any tips as to figure out where in these steps cases are lost ? Thanks! Mirjam [[alternative HTML version deleted]] __ R-help@r-proje

[R] OT: A philosophical question about statistics

2025-05-06 Thread Gregg Powell via R-help
> > they’re more common in teaching. Meanwhile, classic Normal and t > > methods aren’t going away – they’re fundamental and still useful. > > Future students will continue to learn both, getting the best of both > > worlds. > > > > Good luck in your studies! >

Re: [R] OT: A philosophical question about statistics

2025-05-06 Thread Kevin Zembower via R-help
; Thank you very much for your time and effort in answering my > questions. > I really appreciate the thoughts of the members of this group. > > -Kevin > > > > ______ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see h

Re: [R] OT: A philosophical question about statistics

2025-05-06 Thread Kevin Zembower via R-help
what > assumption or which test is problematic and why? > > Tim __ 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 https://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] OT: A philosophical question about statistics

2025-05-06 Thread Kevin Zembower via R-help
till useful. > Future students will continue to learn both, getting the best of both > worlds. > > Good luck in your studies! > gregg ______ 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 https://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] OT: A philosophical question about statistics

2025-05-06 Thread Kevin Zembower via R-help
the easiest and quickest part. Thank you again, Bert, for replying. I always enjoy your contributions to this group. -Kevin ______ 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 https://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] non-reproducible eigen() output with MKL

2025-05-06 Thread smallepsilon via R-help
ago where this was discussed: > > https://www.stat.math.ethz.ch/pipermail/r-help/2023-August/477904.html > > I generally use: > > export OPENBLAS_NUM_THREADS=1 > export MKL_NUM_THREADS=1 > > since in my experience the biggest performance gains come from switching to

[R] OT: A philosophical question about statistics

2025-05-05 Thread Gregg Powell via R-help
going away – they’re fundamental and still useful. Future students will continue to learn both, getting the best of both worlds. Good luck in your studies! gregg On Monday, May 5th, 2025 at 8:17 AM, Kevin Zembower via R-help wrote: > > > I marked this posting as Off Topic because i

[R] OT: A philosophical question about statistics

2025-05-05 Thread Kevin Zembower via R-help
much for your time and effort in answering my questions. I really appreciate the thoughts of the members of this group. -Kevin __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] non-reproducible eigen() output with MKL

2025-05-04 Thread smallepsilon via R-help
if you have eigenvalues that are almost > identical, though.) > > -pd > > > On 4 May 2025, at 17.57, smallepsilon via R-help r-help@r-project.org wrote: > > > > I am using MKL with R 4.5.0 on Linux, and eigen() is producing different > > results with identical calls.

[R] Estimating regression with constraints in model coefficients - Follow-up on Constrained Ordinal Model — Optimized via COBYLA

2025-05-04 Thread Gregg Powell via R-help
PM, Gregg Powell via R-help wrote: > > > Hello Christofer, > > That’s good information. Thanks for the precision. > Think I can use this now to work on a script: > > Based on what you provided: > 1. Two distinct sets of coefficients, β¹ and β², each associated with

[R] non-reproducible eigen() output with MKL

2025-05-04 Thread smallepsilon via R-help
et.seed(20250504) Sigma <- rWishart(1, df = n, Sigma = diag(n))[,,1] e1 <- eigen(Sigma) e2 <- eigen(Sigma) identical(e1, e2) ______ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] Estimating regression with constraints in model coefficients

2025-05-01 Thread Gregg Powell via R-help
t; > > > > > nloptr::nloptr() with a manually coded log-likelihood function > > > > > > > > for the cumulative logit model. > > > > > > > > > > Since you need: > > > > > > > > > > Coefficient bounds (e.g., lb ≤

Re: [R] Overnight Cluster (Whitepaper)?

2025-04-30 Thread Jeff Newmiller via R-help
t;Is there a vendor who sells a plug-and-play solution to this problem? I am >guessing we are not unusual in a setup like this, though an upper price >bound on the software here is of course just the cost of buying a giant >homogeneous computer or using Amazon resources. > >Po

Re: [R] Overnight Cluster (Whitepaper)?

2025-04-30 Thread Ivan Krylov via R-help
memory and CPU core limits, but it might be unable to save you from inefficient job plans. See 'future.batchtools' for an example of an R interface for cluster job submission systems. -- Best regards, Ivan [1] https://github.com/BOINC/boinc/wiki/BOINC-apps-(introduction) __

Re: [R] return inconsistency?

2025-04-30 Thread Jeff Newmiller via R-help
alternate return values to a local variable along different execution paths and require all execution paths to reach the end of the function where that variable name is alone on the last line. On April 30, 2025 2:15:02 AM PDT, Ralf Goertz via R-help wrote: >I made a stupid error w

Re: [R] return inconsistency?

2025-04-30 Thread Ivan Krylov via R-help
On Wed, 30 Apr 2025 11:15:02 +0200 Ralf Goertz via R-help wrote: > If this is not an error what is its purpose? >From the point of view of the R syntax, everything is an expression. One of the uses of return() being an expression is base::callCC(). The ability to use it inside an expr

[R] return inconsistency?

2025-04-30 Thread Ralf Goertz via R-help
ariant (which returns the value of the numerator only) not a syntax error? I would have expected R to report something like > Error: unexpected '/' in "return(OR^2+6*OR+1)/" If this is not an error what is its purpose? ______ R-help@r-p

Re: [R] Estimating regression with constraints in model coefficients

2025-04-29 Thread Gregg Powell via R-help
; > > Equality constraint: sum(β) = C > > > > > > > > C. Likelihood > > > > > > The probability of category k is given by: > > > > > > > > P(Y = k) = logistic(θ_k - Xβ) - logistic(θ_{k-1} - Xβ) > > > > > > > > Without intercepts, this becomes more like: > > > > > > > > P(Y ≤ k) = 1 / (1 + exp(-(c_k - Xβ))) > > > > > > > > …where c_k are fixed thresholds. > > > > > > > > Implementation using nloptr > > > > > > This example shows a rough sketch using nloptr, which allows both > > > > > > equality and bound constraints: > > > > > > > > > library(nloptr) > > > > > > > > > # Custom negative log-likelihood function > > > > > > > negLL <- function(beta, X, y, K, cutpoints) { > > > > > > > eta <- X %*% beta > > > > > > > loglik <- 0 > > > > > > > for (k in 1:K) { > > > > > > > pk <- plogis(cutpoints[k] - eta) - plogis(cutpoints[k - 1] - eta) > > > > > > > loglik <- loglik + sum(log(pk[y == k])) > > > > > > > } > > > > > > > return(-loglik) > > > > > > > } > > > > > > > > > # Constraint: sum(beta) = C > > > > > > > sum_constraint <- function(beta, C) { > > > > > > > return(sum(beta) - C) > > > > > > > } > > > > > > > > > # Define objective and constraint wrapper > > > > > > > objective <- function(beta) negLL(beta, X, y, K, cutpoints) > > > > > > > eq_constraint <- function(beta) sum_constraint(beta, C = 2) # > > > > > > > example >C > > > > > > > > > # Run optimization > > > > > > > res <- nloptr( > > > > > > > x0 = rep(0, ncol(X)), > > > > > > > eval_f = objective, > > > > > > > lb = lower_bounds, > > > > > > > ub = upper_bounds, > > > > > > > eval_g_eq = eq_constraint, > > > > > > > opts = list(algorithm = "NLOPT_LD_SLSQP", xtol_rel = 1e-8) > > > > > > > ) > > > > > > > > The next step would be writing the actual log-likelihood for your > > > > > > specific problem or verifying constraint implementation. > > > > > > > > Manually coding the log-likelihood for an ordinal model is > > > > > > nontrivial... so a bit of a challenge :) > > > > > > > > All the best, > > > > > > gregg powell > > > > > > Sierra Vista, AZ signature.asc Description: OpenPGP digital signature __ 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 https://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] Possible bug in gzcon() (6161:src/main/connections.c)

2025-04-26 Thread Ivan Krylov via R-help
9.csv.gz") calls file(), which can transparently switch to a gzfile() connection, which supports concatenated archives, but gzcon() currently doesn't. Feature request submitted at <https://bugs.r-project.org/show_bug.cgi?id=18887>. -- Best regards, Ivan _

Re: [R] 4.5.0: Do NOT just copy library folder and update.packages()

2025-04-25 Thread Jeff Newmiller via R-help
if there is only one folder for packages under 4.X... where >any version of R $.X... would load from there the packages? > >Thanks > >Fer > >On 4/25/25 11:16, Peter Dalgaard via R-help wrote: >> A couple of people have gotten themselves in trouble by copying the contents

[R] 4.5.0: Do NOT just copy library folder and update.packages()

2025-04-25 Thread Peter Dalgaard via R-help
.5.0. One of them has tools in the 4.4 library and the other does not. I have no clue what the difference might be -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Office: A 4.23 Email: pd@c

Re: [R] How to find inverse of glm model?

2025-04-24 Thread Gregg Powell via R-help
nt"), lin)) : > > > NA/NaN/Inf in foreign function call (arg 5) > > > ``` > > > How can I properly set this regression model? > > > Thank you > > > > > On Wed, Apr 16, 2025 at 7:08 AM Luigi Marongiu marongiu.lu...@gmail.com > &g

Re: [R] Estimating regression with constraints in model coefficients

2025-04-24 Thread Gregg Powell via R-help
- function(beta, X, y, K, cutpoints) { > > > > > eta <- X %*% beta > > > > > loglik <- 0 > > > > > for (k in 1:K) { > > > > > pk <- plogis(cutpoints[k] - eta) - plogis(cutpoints[k - 1] - eta) > > > > > loglik <

Re: [R] How to find inverse of glm model?

2025-04-23 Thread Gregg Powell via R-help
& Statistics > > > University of Melbourne, VIC 3010 Australia > > > Tel: (+61) 0403 138 955 > > > Email: a...@unimelb.edu.au > > > Website: https://researchers.ms.unimelb.edu.au/~apro@unimelb/ > > > > > > I acknowledge the Traditional Ow

Re: [R] Estimating regression with constraints in model coefficients

2025-04-23 Thread Gregg Powell via R-help
; > > eq_constraint <- function(beta) sum_constraint(beta, C = 2) # example >C > > > > > > # Run optimization > > > res <- nloptr( > > > x0 = rep(0, ncol(X)), > > > eval_f = objective, > > > lb = lower_bounds, > > >

Re: [R] Estimating regression with constraints in model coefficients

2025-04-21 Thread Jeff Newmiller via R-help
gt;> >eq_constraint <- function(beta) sum_constraint(beta, C = 2) # example >C >> > >> ># Run optimization >> >res <- nloptr( >> > x0 = rep(0, ncol(X)), >> > eval_f = objective, >> > lb = lower_bounds, >> > ub = uppe

Re: [R] Estimating regression with constraints in model coefficients

2025-04-21 Thread Gregg Powell via R-help
implementation. Manually coding the log-likelihood for an ordinal model is nontrivial... so a bit of a challenge :) All the best, gregg powell Sierra Vista, AZ signature.asc Description: OpenPGP digital signature ______ R-help@r-project.org mailing

Re: [R] problem with my base_df function ?

2025-04-16 Thread varin sacha via R-help
the following error , at the following point in the code ..." ) On 2025-04-16 12:11 p.m., varin sacha via R-help wrote: > R-experts, > > The R script here below. > > How to solve my problem ? > > Best, > > > ## > # Load packa

[R] problem with my base_df function ?

2025-04-16 Thread varin sacha via R-help
 df_sample <- sample_n(base_df, n)   result <- gfci(data = df_sample, test = "kci", score = "sem-bic")   plot(result, main = paste("n =", n)) } #####   __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and mo

Re: [R] How to find inverse of glm model?

2025-04-15 Thread Andrew Robinson via R-help
y of Melbourne, VIC 3010 Australia Tel: (+61) 0403 138 955 Email: a...@unimelb.edu.au Website: https://researchers.ms.unimelb.edu.au/~apro@unimelb/ I acknowledge the Traditional Owners of the land I inhabit, and pay my respects to their Elders. On 16 Apr 2025 at 1:01 AM +1000, Gregg Powell via R-

Re: [R] How to find inverse of glm model?

2025-04-15 Thread Gregg Powell via R-help
Norm[df$Norm<0] = 0 b_model = glm(Norm ~ Cycles, data=df, > family=binomial) plot(Norm ~ Cycles, df, main="Normalized view", > xlab=expression(bold("Time")), ylab=expression(bold("Signal (normalized)")), > type="p", col="cyan") lines

Re: [R] Drawing a sample based on certain condition

2025-04-15 Thread Jeff Newmiller via R-help
ng execution >time? Are you planning on looking at all t and T within a range? > >Tim > >-Original Message- >From: R-help On Behalf Of Bert Gunter >Sent: Monday, April 14, 2025 4:16 PM >To: Duncan Murdoch >Cc: r-help@r-project.org >Subject: Re: [R] Drawing a sa

Re: [R] An opinion question, please

2025-04-10 Thread Jeff Newmiller via R-help
S3 or S4 structure, please? > >I know I will get lots of opinions, but that’s fine. > >Thanks, >Erin > > >Erin Hodgess, PhD >mailto: erinm.hodg...@gmail.com > > [[alternative HTML version deleted]] > >__ &g

[R] Error in running get_acs()

2025-04-09 Thread Deana Kittaneh via R-help
mats. In addition: Warning message: In unzip(file_loc, exdir = tmp) : error 1 in extracting from zip file Error: Your geometry data download failed. Please try again later or check the status of the Census Bureau website at https://www2.census.gov/geo/tiger/ _

Re: [R] Estimating regression with constraints in model coefficients

2025-04-08 Thread Gregg Powell via R-help
pose certain constraints on each of the > model parameters, based on some non-sample information. > > Is there any R function to estimate model coefficients with imposing > some unser-defined constraints on the model parameters? > > Any pointer will be very helpful. >

Re: [R] Request to Unsubscribe from R Forum Replies

2025-04-07 Thread David Winsemius via R-help
gards, > >[[alternative HTML version deleted]] > > __ > 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 https://www.R-project.org/pos

Re: [R] Setting up hypothesis tests with the infer library?

2025-04-05 Thread Kevin Zembower via R-help
all been simulations, bootstraps, randomized distributions, etc. Thank you, again, Rui and Michael, for your help for me. -Kevin On Sat, 2025-03-29 at 16:42 +, Rui Barradas wrote: > Às 16:09 de 29/03/2025, Kevin Zembower via R-help escreveu: > > Hello, all, > > > > We'r

Re: [R] Setting up hypothesis tests with the infer library?

2025-03-31 Thread Kevin Zembower via R-help
hough. Tastes > will > vary. > > In dplyr style, add a column and use it in slice: > > df <- expand.grid(year=c(1980, 2010), DP=c("Approve", "Disapprove")) > %>% >     mutate(freq = c(660, 640, 1000-660, 1000-640)) %>% >     slice(rep(1:n

Re: [R] Setting up hypothesis tests with the infer library?

2025-03-29 Thread David Winsemius via R-help
> On Mar 29, 2025, at 9:59 AM, Kevin Zembower via R-help > wrote: > > Hi, Rui and Michael, thank you both for replying. > > Yeah, I'm not supposed to know about Chi-squared yet. So far, all of > our work with hypothesis tests has involved creating the sample dat

[R] Setting up hypothesis tests with the infer library?

2025-03-29 Thread Kevin Zembower via R-help
ble to do something like this: = (df <- data.frame(group1count = 660, #Or, group1prop = 0.66 group1samplesize = 1000, group2count = 640, #Or, group2prop = 0.64 group2samplesize = 1000)) = Am I overlooking a way to

[R] 3 way crosstable not working

2025-03-25 Thread varin sacha via R-help
quot;female","male","female","male","male")   color=c("red","blue","green","green","blue","red","blue","green","red","blue") data<- data.frame(statut, sex,color)   

Re: [R] PLOTTING ODE MODEL RESULTS USING PLOT.DESOLVE FROM THE DESOLVE PACKAGE

2025-03-25 Thread Jeff Newmiller via R-help
rvations. I checked the >vignettes but did not see this incorporated. > >Mariam. > > [[alternative HTML version deleted]] > >__ >R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see >https://stat.ethz.ch/ma

Re: [R] how to create model matrix of second order terms

2025-03-25 Thread Stephen Bond via R-help
025, Stephen Bond via R-help escreveu: > > Folks, > > > > I appreciate your effort, but maybe I was not explicit enough, so > > let > > me try again. > > > > The current setup for formulas does not allow for I(x^2) terms as > > explained

Re: [R] how to create model matrix of second order terms

2025-03-24 Thread Stephen Bond via R-help
entertain > others, and entertain herself." > > > > On Mon, Mar 24, 2025 at 12:22 AM Stephen Bond via R-help > wrote: > > I am sending to this forum as stackoverflow has devolved into sth > > pretty bad. > > Below code shows how to get what I want in a clu

[R] how to create model matrix of second order terms

2025-03-24 Thread Stephen Bond via R-help
tor crossings using formula a*b*c and then cross with the numerics, which is even more clumsy. Thanks everybody __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] Failure to install any packages: "malformed"

2025-03-20 Thread Ivan Krylov via R-help
re") to see if anything is different, but it probably won't be. -- Best regards, Ivan __ 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 https://www.

[R] Why I wrote my MWE the way I did. [WAS:] Re: What don't I understand about sample()?

2025-03-17 Thread Kevin Zembower via R-help
; tidyverse functionality, switching to use this by default may be > > wise. > > > > My philosophy is to keep thing as simple as reasonable but no > > simpler than reasonable. In programming languages, it is to use a > > simple consistent set of tools that gets me what I wa

Re: [R] MacPorts install of data.table lacks openmp support

2025-03-17 Thread Ivan Krylov via R-help
he output of R CMD config CC (is it /opt/local/bin/clang-mp-18?) and try to find out how to enable OpenMP support for that compiler. Does it need a separate installation of the libomp port? -- Best regards, Ivan ______ R-help@r-project.org mailing list -- To

Re: [R] What don't I understand about sample()?

2025-03-17 Thread Jeff Newmiller via R-help
tent set of >tools that gets me what I want with accuracy and thus it can be simpler to use >the tidyverse a lot as my default. To each their own. > >-Original Message- >From: Richard O'Keefe >Sent: Sunday, March 16, 2025 7:53 AM >To: avi.e.gr...@gmail.com >Cc:

Re: [R] What don't I understand about sample()?

2025-03-15 Thread Kevin Zembower via R-help
bly lazy in not determining which of the multiple functions in the tidyverse library loads read_csv(), and just using that one. Thanks, again, for helping me to further understand R and this problem. -Kevin On Sat, 2025-03-15 at 12:00 +0100, r-help-requ...@r-project.org wrote: > Not having t

[R] [SPAM | WERBUNG] Re: What don't I understand about sample()?

2025-03-15 Thread Kevin Zembower via R-help
oid the trouble of typing the variable into R to verify the contents. My work is all contained in a Rmarkdown file, that I finally export and file with my notes from class to help me study for exams. Thank you, again, for your generous help for me. -Kevin On Sat, 2025-03-15 at 12:00 +0100, r

Re: [R] What don't I understand about sample()?

2025-03-14 Thread Kevin Zembower via R-help
any insight you can share with me, and any suggestions for > getting rows in a matrix with different permutations. > > -Kevin > > *No, this isn't a homework problem. We're using Lock5 as the text in > class, along with its StatKey web application. I'm just trying to g

Re: [R] What don't I understand about sample()?

2025-03-14 Thread Jorgen Harmse via R-help
Date: Thu, 13 Mar 2025 21:00:26 +0000 From: Kevin Zembower To: r-help@r-project.org Subject: [R] What don't I understand about sample()? Message-ID: <01000195914ef9c4-7adadf5d-0069-4794-af09-454452b71c3d-000...@email.amazonses.com> Content-Type: text/plain; charset="ut

Re: [R] R GUI randomly resizes. Is this a known bug?

2025-03-13 Thread Ivan Krylov via R-help
Best regards, Ivan __ 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 https://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

[R] What don't I understand about sample()?

2025-03-13 Thread Kevin Zembower via R-help
t in class, along with its StatKey web application. I'm just trying to get more out of the class by also solving our problems using R, for which I'm not receiving any class credit. ______ R-help@r-project.org mailing list -- To UNSUBSCRIBE and mo

Re: [R] Number changed weirdly when converting to numeric

2025-03-09 Thread Jeff Newmiller via R-help
4-converter/). > >Seems that decimal-to-float conversion has a bug on arm64. Note that I get the >same result with > >> x <- -177253333.33343267441 > >so it's not specific to as.numeric(). > >Best, >Stephanie > > > > >> On 9 Ma

Re: [R] Number changed weirdly when converting to numeric

2025-03-09 Thread Jeff Newmiller via R-help
/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib; > LAPACK version 3.12.0 > > >locale: > >[1] C/UTF-8/C/C/C/C > > >time zone: Asia > >tzcode source: internal > > >attached base packages: > >[1] stats graphics grDevices utils datasets

Re: [R] Issue with littler vs. R and source()

2025-03-08 Thread Steve Martin via R-help
nd ignore the interactive dialogs that use package svDialogs > in the > program I'm trying to develop. Since I can run in R or RStudio by starting > them and > then source()ing, the situation is not critical, but it would be good to > work out > what is failing. > > Jo

Re: [R] Failed to convert data to numeric

2025-03-03 Thread Ivan Krylov via R-help
418180 6.7775277 > 3.2080840 > > [7] 4.1932877 0.3782577 4.6589550 NA There's an invisible Unicode character in there, U+FEFF ZERO WIDTH NO-BREAK SPACE: > dat2 |> tail(1) |> tools::showNonASCII() 1: -9.8814740 Try as.numeric(gsub('\ufeff

Re: [R] [Tagged] Re: Failed to convert data to numeric

2025-03-03 Thread Jeff Newmiller via R-help
?tools::showNonASCII On March 3, 2025 12:09:22 AM PST, Ivan Krylov via R-help wrote: >В Mon, 3 Mar 2025 13:21:31 +0530 >Christofer Bogaso пишет: > >> Is there any way to remove all possible "Unicode character" that may >> be present in the array at once? >

Re: [R] Failed to convert data to numeric

2025-03-03 Thread Ivan Krylov via R-help
ps://regex101.com/>. -- Best regards, Ivan __ 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 https://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] Code \255 no longer working to produce a short dash in base R PDF graphs

2025-02-21 Thread Paul Sherliker via R-help
n Inside my pasted-together constructed titles, I have to use \u{ad}, but _that_ works perfectly. Thank you very much indeed! Paul [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUB

  1   2   3   4   5   6   7   8   9   10   >