Recent content by jamesmartinn

  1. J

    Running simulations in R

    I echo @Dason's remarks about not really needing any specific packages to do simulations in R. I understand the pain points of PROC IML, but R overcomes this kind of by default. I really prefer building simulations from the ground up as it also provides you a chance to think through (or...
  2. J

    How to adjust specific tabletext font to bold?

    No problem, glad it could help. I have the "base" code that powers the shiny app located here: https://github.com/mattkumar/forestplot The example should be completely reproducible.
  3. J

    How to adjust specific tabletext font to bold?

    It's not clear if your data is a result of a meta-analysis? If your data is from a logistic regression or cox model, I have an app here that might help you: https://matt-kumar.shinyapps.io/forestr The app has data pre-loaded in it already as an example. Goto the review tab and click proceed to...
  4. J

    The item response theory - which method to choose

    Hi, The ltm package can fit the graded response model - I used this a long time ago for this very purpose. You might want to also check out the mirt package, which can do uni and multidimensional irt. https://cran.r-project.org/web/packages/mirt/...
  5. J

    Reg ex Question

    Thank you for the quick reply, Dason! You have no idea how much you've simplified my day... (after a very long and exhausting work week)
  6. J

    Reg ex Question

    Hi! I have a string, that follows a predictable format, and I'm looking to replace certain characters in it. Please see below. Any help is appreciated. > have <- "_a _a_1 _a_2 _a_3" > have [1] "_a _a_1 _a_2 _a_3" What I need to do is remove the initial underscore in each space delimited...
  7. J

    Today I Learned: ____

    I'm currently going through Text Mining with R: A Tidy Approach by Robinson and Silge. In this book they mention the {sentimentR} package, which is useful for analyzing sentiments on whole sentences (over words, which I've been doing). I looked into this a bit and I saw it was authored by...
  8. J

    Today I Learned: ____

    TIL i use shiny modules. I have a dashboard that has 4 to 5 pages (representing subgroups), and on each page the elements (graphs, text, tables) are all the same. Made for a good use case. To slightly complicate the matter, I also have a reactive data set powering all the pages (built off a...
  9. J

    Set operations/Anti_join

    Hi all, I'm trying to accomplish a set of tasks that involve set operations/joins. I'm able to solve a bit of this using packages from the Tidyverse. I can't figure out if there's a nicer way to do the last task, please below. The first task is self-explanatory. I have 3 vectors, and I'm...
  10. J

    proc traj

    No. If you've specified the model and interpretted the output correctly, and there's no evidence of unobserved heterogenity in response, why would you think trying to force it would be a good idea?
  11. J

    Logistic regression using Lasso

    I think HPGENSELECT will accomplish LASSO for Logistic Regression (and other GLMz)
  12. J

    Sums of Brownian Motions

    Hi all, I'm working through a textbook on SP and I'm trying to do some of the exercises. Here's the question followed by my attempt at a solution. For a standard brownian motion started at x=-3, find P(X1 + X2 > -1) Let Y = X1+X2 We want P(Y > -1) Finding the distribution of Y: E(Y) =...
  13. J

    Escape Characters?

    Update: I found a solution to the issue here: https://stackoverflow.com/questions/29265172/print-unicode-character-string-in-r Half the battle is knowing what to google lol. If anyone is interested, I can still post up what I have. Thanks again. Cheers
  14. J

    Escape Characters?

    Hi all, I'll attempt to explain what I'm running into though unfortunately I don't have a reproducible example. I'm attempting to load a custom font into R (done) to build a plot using ggplot (done). I'm doing this on Windows 10 if that matters. The font is an emoji-based font...
  15. J

    Iterating in R

    Thanks Dason! You're absolutely right it was way easier in base R. Thanks for the perspective. df <- data.frame(x1=c(1,9,10), x2=c(11,43,3)) df[df==1|df==2|df==3|df==4|df==5] <- NA > df x1 x2 1 NA 11 2 9 43 3 10 NA Any insight to as why the following doesn't work? df[df %in%...