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

2
votes
1answer
33 views

Exact maximum likelihood estimation of MA(1)

I want to calculate the MLEs of the MA(1) model and for this purpose I have written the exact likelihood for the same. I built a programme in R for the log-likelihood, but it seems some problem in it ...
0
votes
0answers
20 views

To take a multidimensional data set to higher dimensions using R [closed]

I have a multidimensional data-set( multiple 'x' variables with a target variable). I want to take it to a higher dimensional space so that I can apply classification technique with ease . Is ...
0
votes
0answers
24 views

how interpret coefficient of a binary variable (coded as 1 and 2 in R) in a logistic regression model

I have a logistic regression model where Pstatus (a binary variable is coded as 1,2 (1 being apart, 2 being together in R see code below) has a coefficient of 0.8. I am wondering how I should ...
0
votes
0answers
12 views

Computing SD for function of two RV's in R gives wrong results [duplicate]

I have 2 random variables, all independant, discrete and uniform I want to compute standard deviation for Z = X - Y Here is the R code: ...
0
votes
2answers
24 views

Lagged independent variables in economic analysis

I am trying to study the effects of foreign direct investment (FDI) in growth of gross domestic product (GDP). It's considered that FDI positively impacts GDP growth and it makes sense to assume that ...
0
votes
0answers
4 views

solving conditional symbolic equation in R [migrated]

Here are my vectors. Note that the vector m consists of unknown value x. ...
1
vote
0answers
11 views

Calculating SE for set of proportions with different sample sizes

Okay, so I have a data set where I'm measuring survival rates under different conditions. I have three treatments, control, pH 1, and pH 2. Each one has six replicates, all of which have different ...
0
votes
0answers
10 views

Neural Networks using neuralnet library [closed]

I am using neuralnet library training NN on data called dta nn <- neuralnet(TargetBuy~.,data= dta, hidden=2,err.fct="ce",linear.output=FALSE) I am getting following error Error in neurons[[i]] ...
0
votes
1answer
60 views

`scale` in R with no normal distribution

The function called scale, in R, does the same of subtracting the mean and dividing by the sd each element. So the scale function allows to take in count differente parameter with different scale. ...
0
votes
0answers
12 views

Regular expression for replicate weights in complex survey R package [migrated]

I was using the survey package in R for analyzing data from the National Crime Victimization Survey. Thomas Lumley's book Complex Surveys: A guide to analysis using R and the help files in his survey ...
0
votes
1answer
18 views

Package in R for choice of attributes [closed]

Is there exists any package that can help me choose attributes using method of random searching with genetic algorithm ?
0
votes
0answers
8 views

Error Cannot find function max.diff.rank.ordered.logit.with.ties [closed]

I am trying to run the maxdiff analysis described in this page on R version 3.2.4 Revised x64 on Windows 7 x64 from RStudio Version 0.99.441 The first error the codes returns is on: ...
0
votes
0answers
20 views

How do we do predictive lead scoring in R? [closed]

Assume my historical data contains(Region,Industry,No.of.Days,Revenue of the company,whether the deal was closed or not) i.e., data of a sales lead. I am concerned about predicting a lead score for ...
0
votes
0answers
10 views

How to interpret glmmPQL summary value

I'm doing a GLMM with quasi-Poisson to check for a spatial correlation between some predator bugs and their prey (count data of predator and prey + added distance of plots). I've added everything into ...
0
votes
1answer
21 views

Obtaining r-squared values from cumSeg/step-function fit

I know its possible to extract r-squared values to quantify the 'goodness-of-fit' of regressions in R, with something to the effect of: ...
0
votes
0answers
35 views

R - Understanding output of the Knoxtest (Package (surveillance))

The function knox of the "Surveillance" package performs Knox test for space-time interaction. The output is supposed to give the numbers of events that occur in a specific distance in space and time ...
0
votes
0answers
9 views

Difference between a GAMM and a nonlinear mixed effects model?

I have some whale watching data and I am trying to see what affects the duration of encounters between tourism operators and whales. The response variable is encounter duration in minutes and my ...
0
votes
0answers
21 views

Interpreting model averaging results in R

I am trying to understand and know what to report from my analysis of some data using model averaging in R. I am using the following script to analyse the effect of method of measurement over a given ...
0
votes
0answers
7 views

Carry manova with contrasts statements in R [migrated]

how can I implement the equivalent Manova analysis of SAS with contrasts which look like this: contrast 'category1 vs category2' category 1 -1 0 0 in R language ? ...
1
vote
1answer
19 views

Weighted, Paired-Sample T-test? in R [closed]

In R you can run a paired t-test (e.g. t.test(x, y, paired=TRUE)) as well as a weighted t-test (e.g. ...
0
votes
0answers
12 views

How to add symbols to bwplot graph [closed]

I would like to add symbols above the boxes of a box and whisker plot created in R to indicate significant differences between treatment levels. The graph I have created is similar to this using the ...
2
votes
1answer
42 views

Multiple Linear Regression with small dataset

I have a dataset of 30 social variables such as Facebook Likes, Posts, Comments, etc. I would like to see if these variables predict Website Views. MY problem is I only have 3 months of data- or 3 ...
2
votes
1answer
28 views

Recurrent event analysis

I want to model patient visits. My assumptions are: Patients visit the hospital until they stop visiting at all. I don't know if their last visit was the last one. Patients visit at certain ...
1
vote
0answers
18 views

Evaluation of Bayes GARCH estimation

I am using the bayesGARCH package to estimate Bayesian GARCH models and I was wondering how to evaluate them in terms of precision of forecast or at least the quality of the model. I have encountered ...
3
votes
1answer
17 views

How to prioritize variables in GLM in R?

I am relatively new to R and GLMs. I have a simple GLM y ~ a+b. a is the dominant variable and I would like the coefficients to basically give more weight to a and then use b to explain the ...
0
votes
0answers
11 views

How to create stratified subsets of one file?

I have one large file with class imbalance problem. I would like to stratify the subset into 10 subsets, and to preserve the ration of class sizes for each fold. So for example the overall class ...
0
votes
0answers
7 views

How to add pseudorandom noise into data - too many ties in knn

I have a discrete training data and I amtrying to model it with caret's knn. Then I saw this post: Dealing with lots of ties in kNN model The accepted answer says that we need to add a very small ...
0
votes
1answer
31 views

Defining lambda value for ridge regression

I try to understand ridge regression. I think the most important point in it is defining lambda value. I researched some R codes but I didn't understand how to define it. In the example here, in the ...
0
votes
0answers
39 views

Clustering analysis according to Spearman $\rho$

I am trying to perform a clustering analysis in R according to Spearman correlation coefficient. Could it happen that the analysis identifies only one big cluster as in the figure attached (the code ...
1
vote
1answer
26 views

Get a 95% confidence interval for Cohen's Kappa in R

I've got a study with two radiologist's reading chest x-rays and want to calculate Cohen's kappa of their agreement. The kappa2 function in the "irr" package and ...
0
votes
0answers
8 views

Selecting dates to format in R, and only altering the year [closed]

I have a dataframe with 730 observations and one of the columns is a date column, all of the dates are supposed to be 2008 and I realise that a few seem to have been mistakenly entered as 2005. is ...
0
votes
0answers
3 views

How to test difference from 50%

I'm using R studio to analyse my data: I have a dataset of zebrafish with independent variables: treatment and sex as in this attached graph. I'm testing the percentage of 600s that the fish spend in ...
1
vote
0answers
25 views

Which statistical test best suits for analysing my data?

I have a simple question. I have seven groups of experimental data like treated (Triplicate) and one control group. Here, I have three variables for each group 1. Body mass, Liver weight and bacterial ...
0
votes
0answers
24 views

What is a better approach to using R, Python and C++? (Single Standalone IDE's or Eclipse with Plugins) [closed]

While using a mix of C++, Python and R is it better to use Standalone packages i.e, RStudio for R, Anaconda for Python and Codeblocks/ Visual Studio for C++ or is it better to use a single integrated ...
0
votes
0answers
16 views

multi linear regression model. Modeling with a heavily skewed binary independent variable

Dataset and goal: One continuous measurement( to be modeled as a dependent variable) and four other measurements (one binary and the rest are category variables with multiple levels) to be modeled as ...
0
votes
1answer
38 views

Negative coefficients for ordinal logistic regression in R

I am trying to model my dependent variable (ordinal - three levels) using a set of independent variables (5 ordinal and 10 numeric). I am using lrm function in ...
0
votes
0answers
13 views

Clustering and differentially expressed genes in RNAseq

I have performed differential analysis with DESeq2, edgeR and voom-limma. My goal was to evaluate each methods on my data. Now I would like to perform clustering with the genes found differentially ...
0
votes
0answers
16 views

How to import Large Datasets in Revolution R Enterprise or R Studio? [closed]

I'm currently using Revolution R Enterprise Version 7.5. I am trying to import a dataset from Excel into RRE. Here is my code: ...
0
votes
0answers
6 views

Plot individual(longitudinal ) trajectories of an lme model using nlme

I have a dataset with id, time(continious) and DFG. ...
7
votes
2answers
425 views

Is every ARIMA(1,1,0) model equivalent to an AR(2) model?

Assume I have a time series $ x_t $ that I want to fit using an ARIMA(1,1,0) model of the form: $ \Delta x_t = \alpha \Delta x_{t-1} + w_t $ This could be rewritten as: $ x_t - x_{t-1} = ...
1
vote
1answer
24 views

Rolling Forecast Re-training Step Concept

I'm trying to understand the steps in Rob Hyndman's Multi-step forecasts without re-estimation example below. I'm wondering what the purpose is of ...
0
votes
0answers
16 views

Obtaining RSS from R strucchange package [migrated]

I'm trying to search for unknown structural breaks in co-integrated time series. $$Y_t = c_t + \beta X_t + e_t$$ Searching for breaks in this context is essentially the same as it would if both ...
0
votes
0answers
45 views

Bayesian Time Series model in R

Similar to the scenario described in this paper, I need to forecast a seasonal time series with only a few periods. I am working with about 2 years of daily revenue data, and I want to forecast the ...
0
votes
1answer
58 views

Noob Data Design Question - 1 on 1 competition

My question is about how to best structure my dataset for a competition between 2 players of a game (for the purposes of prediction of future game winners). There will potentially be hundreds of ...
0
votes
0answers
9 views

timeseries forecasting when datapoints doesn't start at same time period

I have a dataset which has lifecycle information of different products but all the products doesn't start selling in same period or same year/quarter.In this case how should i do time series modelling ...
1
vote
1answer
18 views

how to check if model built is valid or outdated for new data

If i have a classification or clustering model built for retail customers till last year.How do i check if my model is still valid to this year's data? We can check accuracy of model to new data but ...
0
votes
0answers
13 views

handling dataset if some columns have sparse data

1)if in a dataset 8 columns and of them 3 columns have sparse data[lots of missing values].can anyone tell me what are the general practices followed to transform this data before modelling. I know we ...
0
votes
0answers
6 views

How to use php-r [migrated]

I want to use R inside php using php-r. As I am very new to PHP, I would be very grateful if anyone guides me on how to install php-r inside xampp and run the same. I tried putting the PHPR ...
1
vote
1answer
79 views

Independence of two categorical variables & chi-square

I have data as follows: ...
0
votes
0answers
8 views

Save priors in rjags [migrated]

I'm running a bayesian model in rjags, and I would like to be able to output a plot of the trace of the MCMC, the posterior distribution for my parameters (which I can already obtain from coda), and a ...