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

1
vote
0answers
13 views

How to decide which interaction terms to include in a multiple regression model?

I am trying to build a multiple regression model using R. I have a number of predictor variables. I have some basic domain knowledge for which I am trying to build the model. To start with, I included ...
0
votes
0answers
7 views

R packages to calculate Effect Size

There are several R packages with functionality to calculate effect size. Recently I start to use the package pwr. Taking ...
-1
votes
0answers
9 views

New to R , would like some help regarding statistical Arbitrage using R

I am new to R and I was wondering what R can do ? and if I can use it for actual trading using a statistical arbitrage . Basically I want to know if R can : 1. Find the correlation of stocks 2. Find a ...
0
votes
1answer
6 views

Default value on missing columns of data frame in R [on hold]

In R, I've used rpart on training data and then tried to do a prediction on test data. Trouble is that some columns in the training data are missing in the test data; their values should be 0. Is ...
0
votes
0answers
4 views

Extract details info from regsubsets [migrated]

Given a dataset, if we use regsubsets function in R, we are only able to plot the result using a scale like Adjusted R Squared: ...
0
votes
0answers
10 views

How to get an effect size in nlme?

I have recently been asked to provide an effect size for a mixed-effects linear model which I had fit using nlme. After doing a lot of hunting, it's become clear that effect size with mixed models is ...
3
votes
0answers
20 views

How to generate data for gaussian distributions in these 2 scenarios in R? [migrated]

In "Elements of Statistical Learning" by Tibshirani, when comparing least squares/linear models and knn these 2 scenarios are stated: Scenario 1: The training data in each class were generated ...
0
votes
0answers
18 views

Correction for logarithmic bias

I fitted the variable that has been log transformed (log(y + 1)) by means of mixed model. I used lme function from ...
0
votes
0answers
33 views

Incresing number of observations

have a data structured like below data1 time y 1 10 2 2 20 3 3 30 4 4 40 5 5 50 6 of data1 I make data2 ...
0
votes
1answer
12 views

replace value with condition [on hold]

I want to replace more than one values if that values satisfy a condition this is the code that I used ...
2
votes
1answer
40 views

equal standard errors in lmerTest

I have a question about the standard error of mixed model parameters estimated using the lmerTest package. I have 12 sites with 6 treatments over each site. I ...
-1
votes
0answers
13 views

how to find minimum value from data in r? [migrated]

how to get 3 minimum value on the data automatically? data: data <- c(4,3,5,2,2,1,1,5,6,7,8,9) [1] 4 3 5 2 2 1 1 5 6 7 8 9 with min() function just return 1 ...
-1
votes
0answers
18 views

Importing Excel files into R [on hold]

I am unable to Import excel csv format file into R. Could you please help me out from this problem. Regards, Akshatha
0
votes
0answers
8 views

Remove shared sine-wave from time-series data

I have two sets of time-series data which I have smoothed and applied a fast Fourier transformation. I want to check if either of the data sets share similar sine-waves, if they do I want to ...
0
votes
0answers
17 views

AR-GARCH model with r [on hold]

I will analyze time series data and I have already got the data. However, I cannot specify parameters from the data with R. I want to write R code of AR-GARCH with some factors but I cannot find the ...
3
votes
1answer
74 views

Should I reorder principal components after rotation?

I recently noticed that psych::principal reorders principal components on (automatic) rotation, according to their Eigenvalues (from highest to lowest). (Recall ...
0
votes
0answers
18 views

Calculating PCA in risk assessment scores

I have a series of risk assessment scores (1-10) with maximum ranges of differing for the components from 2-4. The total of the 10 scores is then used to assign the species to a particular group, ...
1
vote
1answer
43 views

Proportion testing in R

I have a dataframe in R that contains the the total number of girls and boys at a school, along with the total number of girls and boys who did not complete their summer reading list. I would like to ...
1
vote
0answers
18 views

Same data, different PACF? [R vs Stata]

So I was playing around with R, trying to figure out how to do basic time series stuff. Using the Box-Jenkins Series G ("airline passengers") data, I wanted to plot ACF and PACF. So here's my code: ...
0
votes
0answers
9 views

How to change x axis to handle outliers [migrated]

I have some data with outliers that I'd like to display on a dotplot. When outliers= c(100,400,800,700) you cannot really see the form of the distribution because the outliers skew the x axis. ...
0
votes
0answers
9 views

Regression on World Bank country-level data

I am a beginner at regressions, and I am working on a country-level index based on the volume of certain internet traffic patterns and other indicators (the details of how this index is calculated are ...
0
votes
0answers
3 views

plot.lm with within-subject/repeated-measure ANOVA [on hold]

I'm running ANOVA on an experiment that has one within-subject variable and several between subject variables. The command I use is aov.output <- aov(measurement ~ within_subject_variable + ...
0
votes
0answers
10 views

how to repeated values of row in R [on hold]

This is how the values look like. i wanted to remove the unwanted repeated values from the column ...
0
votes
0answers
8 views

What is the difference between deviance and residual deviance in logistic regression? [duplicate]

In order to test the significance of a logistic regression, we compare the difference in the deviance: \begin{align} G&=D(\text{model without the variable)}-D(\text{model with the variable}) \\ ...
0
votes
0answers
13 views

R - Manually Adding Intercept to glmnet Ridge Regression

Is there a way to manually add an intercept term manually into the glmnet function of R rather than using the built-in intercept ...
0
votes
0answers
27 views
+50

Which Naive Bayes in the Wikipedia article “Naive Bayes spam filtering”?

In this 2006 paper, it discusses that there are many Naive Bayes algorithms: Spam Filtering with Naive Bayes – Which Naive Bayes? The paper states that binary Multinomial NB performs best. I coded ...
0
votes
0answers
10 views

How do I remove the header names in a vector? [on hold]

I have a character vector which looks like this: ` NA1 NA2 NA1 NA2 NA1 NA2 "4e" "41" "4e" "41" "4e" "41" ` I want to remove the NA1,NA2,.... headers ...
1
vote
1answer
44 views

Detecting spatial autocorrelation with no explicit spatial information

I have some ecological data collected from n independent sites spanning a relatively large spatial scale (>10 degrees of latitude), and from each site, n replicate samples were collected but no ...
1
vote
2answers
15 views

how to get attribute importance in a dataset in r?

I have a data set with almost 1/5th of data is NA. Out of all the columns, few are categorical and rest are numerical.My target variable is categorical variable. I want to find the most important ...
0
votes
0answers
25 views

MLE regression that accounts for two constraints

So I am wanting to create a logistic regression that simultaneously satisfies two constraints. The link here, outlines how to use the Excel solver to maximize the value of Log-Likelihood value of a ...
0
votes
0answers
18 views

How do I encrypt specific variables/columns in a data frame in R? [migrated]

There are certain variables in my data frame which need to be encrypted because it contains sensitive data.How do I go about encrypting these columns/variables?
0
votes
0answers
43 views

Random forest feature adjustment

so, I've found the misclassified instances in my Random forest model have lower values in some predictors, how can I adjust the model so that the threshold is more sensitive to these predictors? ...
0
votes
0answers
21 views

Random forest clustering

In my data the classes were defined by binning a variable in 10 bins. After growing the random forest its proximity matrix is viewed as the following MDSplot: As can be seen from the plot all ...
0
votes
0answers
7 views

summary.lm output customization [migrated]

I would like my lm summary output to be a little more compact than usual. I want to remove some newlines, the "Residuals" section, the line with the word "Coefficients". on the positive side, ...
0
votes
0answers
26 views

Installing R & RStudio for Windows [on hold]

I've looked to make sure I'm not asking a duplicate question. So far it doesn't seem that I'm. I've just been put on a project that requires R programming. Though I've programmed a bit before (like ...
0
votes
0answers
10 views

Checking for compatible conditional models

I am trying to implement MICE in R, using the package mice. I keep reading in papers that if the full conditionals we specify are compatible (they factor into a joint), then our inference is valid. ...
7
votes
1answer
98 views

How many sides does a die have? Bayesian inference in JAGS

Problem I would like to do some inference on a system analogous to die with an unknown number of sides. The die is rolled several times, after which I would like to infer a probability distribution ...
5
votes
2answers
33 views

Test for randomness - randtests - fails

Suppose I have a data set provided by PRNG in a matrix form with 400,000 rows and 20 columns. Each row consists 20 unique integer values from 1 to 80. I need to check the correctness of the PRNG. For ...
1
vote
1answer
40 views

R - Same Density but different QQ-Plot?

I have data variable corresponding to quotation amount and I want to find which statistic law this variable follow if there is one. It seems that the ...
0
votes
0answers
3 views

output of doParallel workers [migrated]

Suppose I have a code that does various calculations in a foreach loop, for simplicity let it be this: ...
1
vote
0answers
29 views

adjusting ties for kruskal.wallis

I would like to compare the means of three groups using the Kruskal Wallis test in R. My data looks like this: ...
1
vote
0answers
21 views

Subset based on maximum difference for one variable, minimum for others

This seems like it should be an easy problem to solve, but I can't think of anything nor can I find anything to help me. I'm working with multiple data sets where I have a series of sometimes ...
0
votes
0answers
5 views

How can get F-measure, precision and re call and also Cluster labels in R [on hold]

I am new to R. I want to use hierarchical clustering of R to cluster following distance matrix. ...
0
votes
0answers
18 views

Different results in estimating 3PL model parameters in IRTPRO and mirt(R)

Can someone explain why I obtain different a, b, and c parameters estimates when I use IRTPRO3 and the package mirt from R? The method both uses are Bock and Aiken (1981) - IRTPRO calls BAEM and R ...
0
votes
0answers
18 views

Helmert contrasts: Each level compared to mean of subsequent levels, or mean of previous levels?

My question is what is the accepted definition of Helmert (and Reverse Helmert)? UCLA stats define Helmert contrasts thus: "Helmert coding compares each level of a categorical variable to the mean of ...
0
votes
0answers
6 views

Is it possible to gather webpage response time and plot histogram, with RSelenium? [on hold]

Can I check response time of page and create a histogram per page wise and using RSelenium For example, if I create script for bing search and search R, can R also check the Response time of search ...
0
votes
0answers
6 views

How to use tbats model parameters from a previous execution to fit another series in R?

I trying to model a time-series using tbats from forecast package in R. I have divided the ...
2
votes
1answer
46 views

Arimax Prediction : Using Forecast Package

The arimax function in the TSA package is to my knowledge the only R package that will fit a ...
1
vote
0answers
13 views

Zero Inflated Poisson Regression in R

I have a zero inflated Poisson regression model I want to run R, as my data are over-dispersed and I have many zeros, but I am not sure how to set up the model in R and interpret the output. First, is ...
0
votes
0answers
7 views

Output of fixed effects summary in lmerTest in R and post-hoc tests

I'm doing a two-factor ANOVA using the lmerTest package. Each factor has multiple levels. When one (or more) of the effects are significant, I would like to do a post-hoc test to determine which of ...