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`.

learn more… | top users | synonyms

0
votes
0answers
6 views

Using qgraph on multilevel data

I'm interested in generating correlation network maps, and have come across qgraph in R. While the program is straightforward to use with cross-sectional data (and no clustering), I was wondering if ...
0
votes
1answer
14 views

Is a Fisher exact test for count data appropriate with an ordered factor?

I have the following contingency table: ...
1
vote
0answers
12 views

how to do a repeated measures analysis on my data with linear mixed model in R?

I'm very new to R and stats in general but I think I need to do a repeated measures analysis perhaps using a linear mixed model on my data. Data are behavioural measurements e.g. distance swum for 21 ...
1
vote
0answers
30 views

How to validate a Poisson GLMM model?

I’m using the glmer function from the lme4 package in R to model species richness adjacent ...
1
vote
0answers
14 views

Which analysis is best for my data with repeated measures and 2 treatment groups?

I'm working in R. I have a data set of 21 fish, roughly half in each of 2 treatments. I measured their behaviour over 10 minutes and want to analyse this to look for changes over time (gradient) and ...
0
votes
0answers
13 views

optimizing 2 factors - Can you use NSGA-II to optimize this?

I have 3 machines A, B and C. I would like to rank the machines based on which machine maximizes Score1 and Score2. Score1 and Score2 are performance measures that rang from 0-100%. Below is some ...
1
vote
2answers
15 views

Understanding output of powerTransform

In the car package, we have the function powerTransform which transforms variables in a regression equation to make the ...
0
votes
0answers
11 views

STAR-GARCH modelling in R [closed]

I used STAR model at my paper (in R program), it is about forecasting stock exchange returns. But my model residuals suffer from ARCH effect and remaining linearity. So I need to use multi-regime ...
3
votes
2answers
346 views

The correct way to display non-normal data?

In my university we learned a lot about normal data, but handling non-normal data wasn't really covered. For some benchmarking of an application I have data has a very high frequency around one value ...
2
votes
1answer
34 views

Stepwise regression in R - How does it work?

I am trying to understand the basic difference between stepwise and backward regression in R using the step function. For stepwise regression I used the following command ...
0
votes
2answers
31 views

derivative from regression model in R

My regression model is this: R2 <- lm(lnwage ~ educ + exper + hrswk + educ*exper + educ2 + exper2) and I want to estimate: $\frac{\partial ln(wage)}{\partial ...
0
votes
0answers
21 views

ROCR package… what am I not getting? [migrated]

I am testing a simple case using ROCR package in R. Basically, here is my code. I have a set of true values, and for each value, I have a set of predictions, and my labels are 1 if the prediction is ...
1
vote
1answer
54 views

Funnel plots: random effect model versus mixed-effect model

I am using multi-level meta-analysis model in metafor package in R. The funnel plot for a random effect model (with moderator) and a mixed effect model (without a moderator) are shown below. Including ...
0
votes
2answers
31 views

standardized mean difference vs raw mean difference

Is there a difference between standardized mean difference and raw mean difference when conducting meta analysis or systematic review and the measurement scales are same, would SMD and raw mean ...
0
votes
0answers
13 views

Anova and contrast

How do we use ANOVA and Contrast to compare multiple dependent variables with multiple independent variables in R. Have watched few videos in you-tube but am really confused. How do I compare ...
0
votes
0answers
16 views

Analyzing multifactor data

I'm trying to analyse a dataset in R, looking like this: ...
0
votes
0answers
19 views

Problem with sample function in R [migrated]

What I'm trying to do is use the sample function in R to split up a sequence of numbers into several equal parts for later use, but I'm having a hard time not getting repeated digits even when I ...
0
votes
0answers
19 views

Monte Carlo vs simulation in GARCH (package “rugarch” in R)

What is the difference between a GARCH simulation and a GARCH Monte Carlo simulation? I look in the vingette for the "rugarch" package in R, Introduction to Rugarch. In section 6 Simulation on page ...
0
votes
0answers
29 views

Understanding recurrent SVM in volatility estimation of GARCH model

I read Chen et al. "Forecasting volatility with support vector machine-based GARCH model" (2010) where they implented a recurrent SVM procedure to estimate volatility by a GARCH based model. The ...
0
votes
0answers
6 views

How to find best fitting with this data in r? [duplicate]

I have this data, data frame fit1: fit1 x y 1 0 2.36 2 1 1.10 3 2 0.81 4 3 0.69 5 4 0.64 6 5 0.61 I would find the best exponential fit of the data, how i ...
0
votes
0answers
11 views

What family of GLM when response is Bray-Curtis dissimilarity? Should I use “adonis” instead?

I have some questions about testing for effects of different experimental levels on community similarity. I'll explain my planned experimental design before I ask the questions: I have two methods ...
0
votes
1answer
35 views

Random Forest in R - most important variable causing errors

I'm trying to fit a Random Forest model in R. I've got a DF with 13 factorized variables plus the target one (binary). When I try to use all the variables with ...
0
votes
0answers
29 views

logistic regression with second order methods overfitting

I am trying to test out the effects of second order methods on logistic regression. I have a function that looks like ...
1
vote
0answers
9 views

how should I get 90% interval estimate of log model?

the regression model was lnwage<-log(wage) R1<-lm(lnwage~educ+exper+hrswk) I need to get the 90% interval estimate of percentage increase in wage when there's a unit increase in hrswk. Can ...
0
votes
1answer
29 views

Mention day-wise seasonality for forecasting in ARIMA using R

I have half-hourly electricity data of several homes for a duration of one month. This data is represented in xts time-series format. Now, I need to make ...
3
votes
1answer
16 views

NA in glm model

I have the data here.But When I tried to build the logistic regression model using glm function its shows NA in TotalVisits. I have found similar question on stack overflow but that is answered for ...
-1
votes
0answers
64 views

Overestimated MCMC standard deviation (SD)

I did a simulation study with 100 replications for a complex model with rstan, and I found the standard deviation (SD) of posterior samples is larger than the true ...
0
votes
0answers
13 views

How do I convert an “RWeka” decision tree into a “party” tree in R? [migrated]

I am using the RWeka package in R to fit M5' trees to a dataset using "M5P". I then want to convert the tree generated into a "party" tree so that I can access variable importances. The issue I am ...
0
votes
0answers
9 views

Log-rank test in R for file bmt

I am trying to find if there is any difference between the groups in file bmt in R package KMsurv using log-rank test. I have set H0: no difference in hazard rates between groups, and H1: there is a ...
1
vote
1answer
18 views

uniform histograms in copula approach

I would like to model some time series. For this purpose I have the marginal distribution and want to use a gaussian copula to build the dependency. Following a tutorial the following should give me ...
1
vote
3answers
46 views

How do I find co-linear variables in R

Suppose my data consisted of the data in the dataframe df (below) -- which columns would I drop x, y or z for methods that are allergic to correlated variables? ...
0
votes
0answers
11 views

How to deal with different distribution families in multivariate regression?

Say that I have 2 dependent variables, one continuous and one count: amount of adrenaline (continuous) number of remembered digits in a task (count) and I want to check if these two variables ...
0
votes
0answers
9 views

How to get coefficient for intercept in felm [migrated]

I run the following code in R. And I do not get coefficient for intercept. How can I get the coefficient for intercept? ...
0
votes
0answers
21 views

Define a function in R as the division of two other functions [migrated]

I have defined two functions in R: ftail=makeFun(exp(-x/log(x + exp(1)))~x) ft=D(1-exp(-x/log(x+exp(1)))~x) I want to define a new function as ...
3
votes
2answers
165 views

What is the impact of management on tree mortality caused by insect pest?

I am monitoring tree death caused by insects and potential impact of human treatment on yearly amount of tree mortality in areas with and without human intervention. My data are recorded by remote ...
0
votes
0answers
13 views

Optimization with a part of gradients

I am exploring some gradient-based optimization functions. For my complex objective function, it is easy to calculate gradients for some parameters, but very hard for some other parameters. I am ...
0
votes
0answers
25 views

Evaluation of Logistic Regression

I have ran these two Logistic Regression models (below) on some small data and I am able to interpret the output - significance and direction - of the regressors, but I do not know for sure how to ...
1
vote
0answers
16 views

Testing for differences in variation between variables

I am trying to find out whether it is true that variation in expenditure is greater, for more narrow subsets. e.g. is it more likely that an individual buys an orange instead of an apple, than it is ...
0
votes
0answers
39 views
+50

How to indicate whether the improvement of a ranking is statistically significant over another one in R?

I have two ranked lists of documents (List1, List2). After comparing each of them against the ground truth, I calculate precision at 5 (P@5) metric to measure how good are each of the ranked lists. ...
0
votes
1answer
35 views

Weight values by sample size in a LOESS regression in R [on hold]

Is there a function to weight values by sample size in a LOESS regression in R? I have been told that this function is included in SAS, and I was hoping a similar function existed in R. I am working ...
0
votes
0answers
17 views

how to create factor analysis data in R

I recently learnt about factor analysis and now I wanted to test it by generating samples in $X$ like $$X = FL^T + N$$ where $F$ is a matrix with in each row the factors for one sample, $L$ is the ...
0
votes
0answers
21 views

R - Create correlation matrix from known correlation [migrated]

I need to create a correlation matrix for a 100 dimension standard normal with a correlation of 0.3 (so a 100X100 matrix). I can't find how to do this in R, everything I have found creates a ...
0
votes
1answer
15 views

Using R: I want to create a contingency table with a 4 category variable [closed]

Currently I have data on SEX and outcome. For outcome there are 4 different values possible 1, 2, 3, 4. I want to create a contingency table (so that I can eventually do a Fisher test) such that I ...
0
votes
3answers
71 views

regression coefficient expected to be negative but it is always positive

In my research project I have to do a regression of the financial risk on the business risk of the year before. As a reference, I have a paper showing the results for several countries. The paper ...
0
votes
1answer
10 views

constructing random effects design matrices for lassop{MMS}

I'd like to use elastic net regression for coefficient estimate and parameter selection on a data set that includes nested structure. I've been experimenting with lassop{MMS} to do so. I'm not a ...
1
vote
0answers
16 views

Fourier Transform in “Syuzhet” package of R

I am performing sentiment analysis on movie scripts using the “Syuzhet” package in R. Below is my sample code: ...
2
votes
2answers
56 views

What are the error distribution and link functions of a model family in R?

When building models with the glm function in R, one needs to specify the family. A family specifies an error distribution (or variance) function and a link ...
3
votes
2answers
62 views

Why do p-values change in significance when changing the order of covariates in the aov model?

I have a data set of 482 observations. data=Populationfull Im going to do a genotype association analysis for 3 SNPs. Im trying to build a model for my ...
1
vote
0answers
13 views

Test of significance for glmer

I would like to test the effect of a treatment ("crop") on species richness. I would rather use a glm for richness as it is a kind of count data. Besides, I have a nested sampling design (5 values ...
0
votes
0answers
24 views

glm.fit: fitted probabilities numerically 0 or 1 occurred [duplicate]

I have just started learning classification techniques in R. I am using a Yelp dataset to predict whether a user is an elite user or not. I tried to build a trained model using logistic regression ...