Questions tagged [r]

Use this tag for any *on-topic* question that (a) involves `R` either as a critical part of the question or expected answer, & (b) is not *just* about how to use `R`.

Filter by
Sorted by
Tagged with
1
vote
0answers
11 views

high-dimensional multivariate regression with R

think of the following data: two z-standardized dependent variables = continuous (here, both reflect a deviation of age but in different tissues) many predictors for a rather small data set, possibly ...
0
votes
0answers
7 views

randomforest with global monotonicity constraint in R [closed]

Is anyone aware of an R package (derived from randomForest I suppose) that imposes global monotonicity constraints for certain features? Thanks!
0
votes
1answer
15 views

Hourly forecast [closed]

I am trying to forecast hourly Oil prediction based on each product. The data is from 04-01-2018 to 14-01-2020. I used frequency 24.The problem is that data is irregular like some days are missing due ...
0
votes
1answer
13 views

Which model should I use for ordinal data if one or some variables violate equal slopes

I have running the data for an experiment. There are 3 independent variables in my data namely "Rhyme", "Meter" and "Lexicality" all with 2 levels (0/1) respectively. Based on these parameters the ...
1
vote
1answer
26 views

Unknown change point mixture model in JAGS

I'm trying to fit a bivariate unknown change point mixed model data comparable to the one described by Wang & McArdle, 2008 (DOI: 10.1080/10705510701758265). I want to model a linear trend before ...
1
vote
0answers
5 views

Different PLS model when using plsr() function in R or Minitab PLS regression menu

I have a PLS model made in R with plsr() function (from package pls); I have chosen the right number of components with cross ...
0
votes
0answers
23 views

how can i calculate p value of data set in R? [closed]

i have given data set of miRNA sequence raw read counts. want to analyze data set using p value. How can i calculate p value of given data set?
0
votes
0answers
12 views

Does anyone know how to perform close returns plot?

How to do Close returns plot in time series? I have to plot time series problems using close returns plot but i cannot find some books to help me find the basic how-tos. a material i have found is ...
1
vote
0answers
16 views

Simulations using correlated random numbers from Multivariate Normal and fat-tailed distributions

This question makes use of the LaplacesDemon package in R, but it is not a coding question, so I believe this is the most appropriate forum. First, the unsurprising results. I generate k correlated ...
2
votes
1answer
32 views

LMM model with nested design and random slopes: how to fit the autocorrelation term?

I am currently running a linear mixed model with a nested design and random slopes. For example, let's imagine some monthly captures of wild rabbits in kilograms in 5 sites during 21 years: ...
0
votes
0answers
9 views

Personality analysis using quanteda

In bibliography there is a way to calculate the big five personality factors using LIWC lexicon. I use quanteda to calculate the score for the five factor using the variables from LIWC such as: ...
0
votes
0answers
22 views

Determining Profit for 150 different Treatments Types

My objective is to show which treatment or group of treatments was most successful at generating profit. I have a data.frame with about 7 million observations. Each of these observations could ...
0
votes
1answer
69 views

How to compute Variability Independent of the Mean (VIM)

Although I find this reading regarding the interpretation of the Coefficent of Variation (CoV) very interesting, I did not found hints regarding the Variability Independent of the Mean (VIM) which is ...
0
votes
0answers
7 views

Is it similar to but trt*period in a model as to compare each treatment to each period in a one way anova?

I want to know if there is any difference between the periods for each treatment. Baseline is included as a covariate.Should this give the same results? I know lmer include a random effect and lm ...
1
vote
0answers
16 views

Probability of not drawing a set of numbers from distribution

I'm running a simulation where random variates are drawn from a negative binomial distribution, with size s and mean mu. I need ...
0
votes
0answers
11 views

classification with rpart: why my confusion Matrix is not working?

I have a data set of 699 rows and in the exercise I'm working on it is requested to generate a training set of 300 observations. The rest will be the test set. I write all the possible information in ...
5
votes
1answer
66 views

The lines on my scatterplot for ANCOVA results doesn't look right, personal error or model error?

I ran an ANCOVA model, to test the effect of treatment on the relationship between two continuous variables (elephant number and plant density) - please see more details in my last question (What ...
1
vote
0answers
9 views

Two way repeated measures with baseline and multiple time-points

We have a repeated measures experiment. Each person had their temperature measured once before, and every minute (for 15 minutes) after two different interventions. As each of the two different ...
1
vote
0answers
9 views

Pooled panel regression with group-wise clustering by time

How can I compute t-statistics for the coefficients of the pooled panel regression model below such that I account for group-wise clustering by time? $$ Y_{it} = \alpha + \beta x_{it} + \epsilon_{it} ...
0
votes
0answers
17 views

how to interpret the smoothed effect of time in GAMM models

I have recently taken a plunge into the world of Generalized Additive Mixed Models (GAMMs) after learning that including the quadratic and cubic fixed and random effects of time to understand students'...
0
votes
1answer
17 views

Neighborhood matrix in spatio-temporal model

I am attempting to create a neighborhood matrix (poly2nb in spdep) in R to use either for a GAM or an INLA. As I have spatio-...
0
votes
0answers
14 views

Which model to use for analyzing complex survey data (Regression, Random Forest …) [duplicate]

I have a sample of $15,000$ households (survey on households' expenditures) of which only 3% have zero consumption. I would like to explain electricity expenditures (Elec_exp_hh) by total household ...
1
vote
0answers
28 views

Meta-Analysis without a Control Group

I am conducting a systematic review and meta-analysis which is investigating health-related quality of life in a particular patient population. I am having difficulties with conducting the meta-...
0
votes
0answers
21 views

How to best display the distribution of a large dataset with many outliers? [duplicate]

I have a very large data set (~300'000 data points) and a subset of it (6000 data points), which shows the difference of travel time [in seconds] of agents before and after a road closure. I want to ...
0
votes
0answers
34 views

Equivalence testing with multiple means in R

I have a question regarding equivalence testing with multiple means in R. Let's say I create a sample dataset, in which I perform a test on 4 different timepoints: ...
0
votes
0answers
18 views

.npz files in Survival analysis [closed]

So basically I have to predict remaining time for a lung cancer patient based on features that have clinical.csv and radimoics.csv,and images that contains alot of .npz files with .npy scan and mask. ...
0
votes
0answers
22 views

One year of daily data - Holt Winters

I am doing basically my first forecasting model in R and I have some questions. I used Airbnb data available from this Kaggle project: https://www.kaggle.com/airbnb/seattle I had to use statistic ...
0
votes
0answers
13 views

Quantile Plot in RMS::orm [migrated]

I'm not sure if this question is more pertinent to CrossValidated or StackOverflow. I'm happy to migrate it if necessary. I'm trying to reproduce the plots from Roger Koenker's quantile regression ...
0
votes
0answers
14 views

GARCH mean parameter estimation in R (rugarch)

I cannot seem to figure out how rugarch calculates the parameter $\mu$ when fitting a specific model For example: ...
0
votes
0answers
14 views

How can I count the number of value changes in a column in R? [closed]

I am trying to count the number of times a value changes in a column, but not necessarily the number of unique values. For example in this list of numbers, there are four value changes (starts with ...
1
vote
1answer
21 views

How do I analyze a three factor ANOVA without replication in R?

This summer, I conducted a growth chamber experiment testing the effects of the projected climate change conditions on the growth and survival of newly germinated seedlings of Acadian forest tree ...
2
votes
1answer
38 views

Std. Error estimates in mixed model of a parallel group design with repeated measurements are not as I expected

I have multilevel data and I would like to use mixed effects linear model. For each subject (sampleName variable), I have repeated measurements (...
0
votes
0answers
8 views

Fit unknown change point mixed model in JAGS [closed]

I'm new to JAGS and bayesian estimation and trying to fit a model described by Wang & McArdle (DOI: 10.1080/10705510701758265) in JAGS via R. Here's my code: ...
0
votes
1answer
28 views

R² for a negative binomial regression model

I have been searching quite a while to find a useful way for calculating (an estimate for) the explained variance for a negative binomial regression model in R... Knowing that the "explained variance" ...
1
vote
0answers
17 views

Can I, and how do I, apply box-cox transformation if I only have mean and SD?

I am doing a meta-analysis of inflammatory markers, for which I have the means and SDs. Some distributions are skewed, and I don't have medians or other parameters, and was trying to get the data as ...
1
vote
1answer
26 views

Continuous continuous interaction term in R

My problem is visualising a regression I have made, but I am unsure on how to visualise it. I have an interaction term both variables are continuous. What graphs can I use to accurately depict this ...
0
votes
1answer
28 views

Are there any exceptions assumed for linear relationships? [closed]

I have the following graph. It is a bit confusing for me to consider it as linear or non-linear. Can experts please give a review if it's linear then why and non-linear then why?
0
votes
1answer
24 views

Can I use the Anova (type II) to test significance in my negative binomial regression?

I have fitted a binomial regression (glm.nb using the MASS package) to my data. I have two questions and would be very thankfull if you could answer any of them: 1a) Can I use the Anova (type II, ...
0
votes
1answer
24 views

Sine curve fit and model tunning using nls in R

I acquired data (motor adaptation =y in function of delays =t ) which I expect to look like a sine wave. I am trying (1) to fit a sine curve in my data and (2)to estimate the best model/parameters. I ...
1
vote
0answers
22 views

Which effects and which interactions are significant?

I'm performing an experiment with five main effects resp. 6-7 since these main effects influences are studied on 20 sensors (which can be grouped into 3 ...
-1
votes
0answers
27 views

How to choose the best regression model

For my statistics analysis, I try to understand the variables that influence collaboration of Europese universities with china. At this point in time, de DV = Chinese publications/total publications ...
0
votes
0answers
12 views

What to use: linear glm wls etc?

This is probably a basic enough question. What I want to achieve is a regression analysis of lapse rates on savings type policies. Say in one year person A withdraws 10 out of 100, and person B ...
1
vote
0answers
9 views

Can I use the Anova (type II) to test significance in my negative binomial regression? [duplicate]

I have fitted a binomial regression (glm.nb using the MASS package) to my data. I have two questions and would be very thankfull if you could answer any of them: 1a) Can I use the Anova (type II, ...
0
votes
0answers
20 views

Sine curve fit using nls in R

I acquired data (motor adaptation $y$ as a function of delays $t$ ) which I expect to look like a sine wave. I am trying (1) to fit a sine curve in my data and (2) to estimate the best model/...
0
votes
0answers
20 views

Bootstrap in Design of Experiments [closed]

Does it make sense to perform bootstrap analysis for coefficients in a Design of Experiments data set, given that excluding treatments can introduce multicollinearity?
1
vote
1answer
37 views

Have I used the glm poisson model correctly?

I have a 3 way factorial experiment with the factors of watterlogging (waterlogged and non-waterlogged), cultivar(4 types) and phosphorus (P) rate (5 levels), and 4 reps. There was some damage due to ...
1
vote
1answer
25 views

Scale of time covariate in `corCAR1()` matters?

I'm running a bunch of GAM analyses on time series data (measurements of my own weight). Unlike many examples I see online, my data is not spaced evenly in time. In fact, time points can come minutes ...
0
votes
1answer
11 views

Calculating Ridge Regression Coefficients in R When Using K-fold Cross Validation [closed]

I'm trying to use k-fold cross-validation in creating a ridge regression model, but I'm not exactly sure how. I'm using a code similar to the one linked here, but I can't seem to find the ...
1
vote
1answer
21 views

(How) do I need to account for censored data in LCMM?

I have a large dataset of within-individual repeated measures, where each participant has varying number of observations (multiple rows of data for each participant). Missing data is largeley non-...
1
vote
0answers
11 views

Relationship between Conditional R squared and random effect variance?

I have run a simple lmer with one fixed effect (day) and 3 random effects (athlete, infusion and sport). Model below. ...