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
7 views

Placement of words in a word cloud as per its occurance. [closed]

I am working on a word cloud where in I want the words to appear in the same order as in the sentence/text. I only know the random.order - which plots words in random order. If false, they will be ...
3
votes
2answers
343 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 ...
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
51 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
14 views

Multivariate Regression with R using time variables [closed]

I am trying to do a multiple regression analysis with R but I am not sure how to incorporate date values into the regression analysis. I would like to build a model that predicts the number of ...
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
34 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
28 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
61 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
11 views

Multiple Logistic Regression involving Interaction between Quantitative and Qualitative Explanatory Variables [closed]

I want to fit multiple logistic regression involving Interaction between Quantitative and Qualitative Explanatory Variables. This can be achieved through glm ...
0
votes
1answer
18 views

how can i combine estimates from quantile regression over multiple imputed datasets? [closed]

I have multiple imputed datasets, applied quantile regression on those and want now to pool the estimates. However, I was not able to get the variance-covariance matrix of the regression estimates ...
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 ...
0
votes
0answers
16 views

I am getting a MNM model in returned ets object. Can this model be fitted into a conventional name? [closed]

I am using Hyndman's ets function with all defaults. I am getting a MNM model in returned ets object. Can this model be fitted into a conventional name ? ... Since this question was put on hold for ...
1
vote
1answer
17 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
43 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
10 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 ...
-1
votes
1answer
20 views

R - serialize/deserialize models as JSON [closed]

Is there some good R package that can convert prediction models and other complex object to and from JSON? I have linear regression model from this example: ...
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
158 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
12 views

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

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
0answers
34 views

How to perform a repeated measures test on my data in R? [closed]

I have a dataset of fish whose behaviour has been measured before and after a treatment, and there are 2 genotypes of fish which I am looking at. I'm using R but any advice on which statistical test ...
0
votes
1answer
24 views

Weight values by sample size in a LOESS regression in R

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
0answers
7 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
15 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
61 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 ...
1
vote
1answer
25 views

Treatment of categorical data in R [closed]

I work most of my time with categorical data (predictors and outcome), I usually do a trees in SPSS to make groups and rank which groups are more predominant to buy / not buy. But now I'm into R, and ...
0
votes
0answers
7 views

Interpretation of ellipse3d in R

I was looking at the information provided as part of the "complete guide to 3D visualization device system in R - R software and data visualization" ...