[R] Specifying non-linear mixed effects models in R (non-linear DV)

2021-08-24 Thread Patzelt, Edward
Hi R-Help, Data is below. I used a Kruskal Wallis to compare across 4 study groups for my DV (beta - this is highly non-normal). Now I want to add a covariate (cpz). 1) What package do I use and how do I specify the model? (I tried T.aov from fANCOVA but received a lot of simpleLoess errors) 2)

[R] Data conversion

2019-09-18 Thread Patzelt, Edward
Hi R Help, How would I convert the data below so that I have it formatted with trials along the rows and then each type of measure separately? e.g., Subject RT OnOff Feedback Trial_1 Trial_2 Trial_3 Trial_4 Thanks! Edward structure(list(TAP_ID = "967372 ", TAP_Date = NA_real_,

[R] Modeling regressions with 2 DV's?

2017-04-22 Thread Patzelt, Edward
Hi R project, I have a data set (see below) where I have 2 parameters estimated from a computational model ("lowStakesW", "highStakesW") which represent 2 separate conditions in the experiment. I would like to find out the relationship of the variable "compulsiveIntrusive" to each of these conditi

[R] Splitting on metacharacters

2017-03-28 Thread Patzelt, Edward
Hi R-help, I would like to: Extract the "26" and "f" from the following string (i.e. age and gender). I've tried a bunch of strsplit, grep, etc. Please help! *"{\"Q0\":\"37\",\"Q1\":\"f\"}"* Thanks, Edward -- Edward H Patzelt | Clinical Science PhD Student Psychology | Harvard University *C

[R] Estimated Marginal Means from PSCL Object

2017-01-20 Thread Patzelt, Edward
Hi R-Help, I have a pscl zero-inflated poisson regression object from which I am trying to extract the estimated marginal means by category (e.g. GROUPA), I can't figure out what I'm doing wrong with the lsmeans package: FU1NSSI<-zeroinfl(W8_PAST4WEEKS_NSSI ~ GROUPA, na.action="na

[R] Testing significance of individual regression slopes

2016-09-27 Thread Patzelt, Edward
Hi R-help, I have an lmer logistic regression with a within subjects IV and subject as a random factor: model <- lmer(optimal_choice ~ level_one_value_difference + (1|subid), data = dat) What I want is to test if the individual subject regression coefficient is significantly different from 0.

[R] Unique Ordering

2016-04-22 Thread Patzelt, Edward
Hi R-Help, data at bottom I've been struggling with a problem where I need to order based on 1) the Frequency "Freq" and 2) keeping each group of 3 of the same type together "Var2" but I want across all groups it to go "high to low" based on the earn factor. Thank you! structure(list(Var1 = str

[R] Optimization Grid Search Slow

2015-09-17 Thread Patzelt, Edward
R Help - I am trying to use a grid search for a 2 free parameter reinforcement learning model and the grid search is incredibly slow. I've used optimx but can't seem to get reasonable answers. Is there a way to speed up this grid search dramatically? dat <- structure(list(choice = c(0, 1, 1, 1,

Re: [R] Identifying Values in Dataframe

2014-10-06 Thread Patzelt, Edward
e- > > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > > project.org] On Behalf Of Patzelt, Edward > > Sent: Thursday, October 02, 2014 10:18 PM > > To: R-help@r-project.org > > Subject: [R] Identifying Values in Dataframe > > > > R Help -

[R] Identifying Values in Dataframe

2014-10-02 Thread Patzelt, Edward
R Help - I'd like to identify each correlation value in the dataframe below above/below .3/-.3 in order to graph the original data points. I've started with the call below to identify each value by it's row and column. I'd like to form a data object that identifies each set of variables that meet

Re: [R] Correlation Matrix with a Covariate

2014-09-02 Thread Patzelt, Edward
, TX 77840-4352 > > > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Patzelt, Edward > Sent: Monday, September 1, 2014 7:47 AM > To: R-help@r-project.org > Subject: [R] Correlation Matrix with a Covariate &

[R] Correlation Matrix with a Covariate

2014-09-01 Thread Patzelt, Edward
R Help - I'm trying to run a correlation matrix with a covariate of "age" and will at some point will also want to covary other variables concurrently. I'm using the "psych" package and have tried other methods such as writing a loop to extract semi-partial correlations, but it does not seem to b

Re: [R] Euclidean Distance in 3 Dimensions

2014-08-21 Thread Patzelt, Edward
s the distance matrix computed by using > the specified distance measure to compute the distances between the rows of > a data matrix. > > Is this what you want? Computing on a matrix whose rows are your x, y, > and z values? > > > On Aug 20, 2014, at 1:12 PM, Patz

Re: [R] Euclidean Distance in 3 Dimensions

2014-08-21 Thread Patzelt, Edward
r-help-boun...@r-project.org] > *On Behalf Of *Don McKenzie > *Sent:* Thursday, August 21, 2014 1:44 PM > *To:* Patzelt, Edward > *Cc:* R-help@r-project.org > *Subject:* Re: [R] Euclidean Distance in 3 Dimensions > > > > Ugh sorry. I misread your message obviously. Cc�ing

[R] Euclidean Distance in 3 Dimensions

2014-08-20 Thread Patzelt, Edward
R Community - I am attempting to write a function that will calculate the distance between points in 3 dimensional space for unique regions (e.g. localized brain regions such as the frontal lobe). For example I'm looking to compare each point in region 45 to every other region in 45 to establish

[R] Lavaan Model Specification

2014-04-30 Thread Patzelt, Edward
R Community - I'm trying to build the model in the image below, but having troubles correctly specifying the syntax: library(lavaan) library(semPlot) lower <- matrix(c(1, 0, 0, 0, .475, 1, 0, 0, .738, .643, 1, 0, .608, .721, .823, 1), 4, 4, byrow = TRUE) colnames(lower) <- rownames(lower) <-

[R] Plotting Simple Slopes with Multilevel Categorical Moderator

2014-04-10 Thread Patzelt, Edward
R - I've got a DV with 2 IVs one of which has 5 levels. I tried using the "pequod" package; however found that it is not able to graph/simple slope a moderator with multiple levels. Is there a package available to do this? (data below) dat$gpa <- as.factor(dat$gpa) mod1 <- lmres(item25 ~ psd * g

[R] Parsing Complex Text in Single Cell

2014-01-29 Thread Patzelt, Edward
R Experts - We have a complex problem whereby Qualtrics exported our data into a single cell as seen below. We attempted to parse it using scan() without much success. Hoping to get a little nudge here. I've posted the full data set here: https://www.dropbox.com/s/e246uiui6jrux6c/CoopandSelfContr