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 program in `R`.

learn more… | top users | synonyms

0
votes
0answers
25 views

Deciding overall similarity measure at each step of hierarchical clustering in r

I want to decide the appropriate number of clusters after using hclust() and drawing a dendogram. I don't have any idea about how many clusters should be there ...
1
vote
0answers
11 views

Heckman's selection / switching model- selection variable as a regressor

I am conducting some analyses on the effects of membership and the membership rank on income. Everyone in the sample can choose to apply to join an organization. The membership is given upon ...
0
votes
0answers
21 views

Dealing with outliers: Clustering

I am working with a dataset in R that I will be doing cluster analysis on and I am trying to determine the best way to deal with the outliers.I have twelve variables and most variables have between ...
1
vote
0answers
33 views

How to statistically validate a threshold?

I have a set of 3 parameters that were measured for several individual (each dot of the dotplot is one individual). I am trying to define subpopulations of individuals based on these measurements. ...
0
votes
0answers
25 views

forcing certain parameters to be skipped during optim in R

I have a code which tests each possible order of ARIMA and selects the best model by choosing the one with the absolute minimum sum of lags from the PACF graph. The code then proceeds to add weight to ...
0
votes
0answers
22 views

R, Confusion Matrix in percent [migrated]

In R how to get Confusion Matrix in percent (or fraction of 1). The "caret" package provides useful function but shows absolute number of samples. ...
0
votes
0answers
9 views

Standard error of prediction MARS splines earth package

I'm using the earth package (using caret train function) MARS spline implementation in order to perform non - linear regression modeling. I would like to obtain a measure of prediction uncertainty ...
0
votes
2answers
39 views

Definitions of coefficients from Arima {forecast}

I'm trying to explain in detail step by step what my code does and I am stuck at explaining what the coefficients are in an Arima model and where they are from/what relevance they have. Could someone ...
0
votes
1answer
21 views

Retrain Time Series Models

I'm new to TS modeling, but have some experience in classic classification modeling. In classification I can train one model and use it for some time while some indices are stable (e.g. PSI). ...
0
votes
0answers
15 views

Methods for predictive modeling on continous target

I am trying to put a continuous target into predictive modelling method. The target is an amount that can range from 0 to unknown. I have roughly 1000 records (for modelling and validation ...
2
votes
1answer
83 views

Use QQplot to check if data fits exponential distribution

I have a dataset which contains about 10000 numbers(class numeric), I want to use QQ plot to see if the data fits the exponential distribution. This is what I did ...
0
votes
1answer
59 views

Learning R with Coursera's Data Science Specialization [closed]

I'm interested in moving into data science and I'd like to learn R. I've looked over previous questions and found a list of resources for learning R here and here. However, these questions were ...
0
votes
1answer
31 views

regarding the explanation of interaction plot

I was trying to draw an interaction plot for two predictor variables as follows: interaction.plot(xtest[,2],xtest[,8],y) I got the following plot. I do not know ...
0
votes
0answers
16 views

Loading data with missing values as numeric data [migrated]

I am trying to impute missing values using the mi package in r and ran into a problem. When I load the data into r, it recognizes the column with missing values as a factor variable. If I convert it ...
0
votes
1answer
37 views

R - glmnet - cross validated - AUC [closed]

I have just started working with the glmnet package in R. I have s a dataset which has about 130,000 features and about 32000 rows of data. Here is the code to create the model ...
1
vote
1answer
62 views

R - glmnet - Not all features being considered

I have just started working with the glmnet package in R. I have s a dataset which has about 130,000 features and about 100 rows of data (actually there are about ...
0
votes
1answer
25 views

Constraining norms with inequalities [closed]

I have time-series data for N stocks. sample.data<-rep(10,rnorm(100)), where each column shows the returns of different stocks over time. I am trying to ...
0
votes
0answers
15 views

Creating a jpeg or TIFF for a loop of negative binomial GLMs in R [migrated]

I have made a loop to perform 4 negative binomial GLMs and now I want to graph them in a TIFF. What would be the best way to do this? ...
0
votes
0answers
10 views

Replaing NAs with correlated values in rows [migrated]

Hey All I have data frame with 5 Samples A,B,C,D,E. and what I want to do is firstly search for a mirna which is overall highly correlated with the miRNA having the missing value and taking a value ...
0
votes
1answer
35 views

Polynomial regression P value is getting altered

I am running following data and code for analyzing non-linear regression and to get simplest equation of curve that fits the data: ...
4
votes
3answers
148 views

Inconsistency between R and SAS for MLE on Weibull

I have the following data Y which I want to get an MLE estimate for the parameters using a Weibull distribution in R. 1468, 1872, 475, 1372, 3830, 1849, 978, ...
1
vote
1answer
42 views
0
votes
0answers
19 views

Generalized likelihood ratio test

Does anyone use the generalized likelihood ratio test for detecting a sudden change in time series forecasting (ARIMA Model)? A paper by Bonne Zhu uses this technique for anomaly detection, but I ...
0
votes
0answers
13 views

geeglm not recognizing clusters

I am fitting a geeglm model and it is not recognizing the clustering. my model is ...
0
votes
0answers
21 views

the reason that adding one more predictor variables will cause lm model to be all NA

I have a data set with multiple predictor variable candidates, and try to experiment with different combinations. During the experiment process, I tried using the first 9 variables, ...
0
votes
0answers
39 views

Plotting a graph in R that features several dependent values for every independent sample point

A class has 40 students. Each student has submitted 14 homework assignments. Each submission was given a grade in the set {1, 2, 3, 4, 5}, with 5 being the grade given to excellent submissions and 1 - ...
0
votes
0answers
30 views

Analysis of the Benjamini-Hochberg adjusted p-values

I have: Condition #1 : 5 independent objects (1 object = a time series) Condition #2 : 5 independent objects My GOAL: test H0 that using condition #1 gives different results from using condition ...
0
votes
1answer
32 views

Multilinear Model with fixed intercept

I would like to fit the following model Y (t) = m (t) + b * t + g * C (t) + N (t) with m (t) to be the long term mean monthly values (remove seasonal component), b ...
0
votes
0answers
34 views

Learning Decision Trees on Test Data Using R

How can I use R to learn classes on test data? I currently have a training set of about 1000 entries and a test set of about 10000 entries. I split it up so that the training set has the class label ...
2
votes
0answers
60 views

Simulation of Monte Carlo test

Using R, I am trying to simulate how the power of a Monte Carlo two-sample test for central tendency changes with sample size. However, my simulation results does not show power increasing with sample ...
1
vote
0answers
22 views

Visualizing time spans on a timeline as a horizontal histogram / bar chart [migrated]

I have a csv table of 6 events and the time span of their occurrence. My variables are begin date, end date, and event-ID. I intend to create a horizontal histogram / bar chart visualization that ...
0
votes
1answer
49 views

Prediction with categorical variables in Cox regression

I'm doing survival analysis with Cox PH. I have my final model based on averaged models and I have four categorical variables with multiple levels each. I computed the fitted values using ...
0
votes
0answers
8 views

Pairwise comparison of slopes from multivariate regression model in R

I am investigating size changes over time. I have five size variables in a multivariate linear model against year. I used the Anova() function in the car package to test whether the slopes are equal ...
1
vote
1answer
13 views

Association rules (market basket analysis) - rules involving the absence of items?

I was wondering if associations rules can include the absence of an item, for example, in this simplified set of transactions: ...
4
votes
1answer
128 views

How to formulate linear mixed model to find out effects of continuous variables?

I have a dataset with growth rate as a response variable (resp in the example) and temperature, food availability, and salinity as predictor variables (...
0
votes
0answers
11 views

1-period rolling out of sample forecast for dynlm model

I have six monthly time series that span from January 2005 until June 2014. I'm trying to test two different dynamic linear models and compare how they perform in one period ahead forecasting. I have ...
1
vote
0answers
21 views

How to account for overdispersion in a glm with negative binomial distribution?

I'm analysing count data with a generalised linear model in R. I started with a Poisson family distribution, but then realized that data was clearly overdispersed. I then took the option of applying a ...
1
vote
1answer
14 views

HMMFit underlying algorithms

After reading article "Hidden Markov Models for Controlling False Discovery Rate in Genome-Wide Association Analysis" by Zhi Wei I am trying to use it in my project. I am using R and I have found out ...
0
votes
0answers
6 views

Classification under uncertainty in observations

I am tackling a multiclass classification problem where the values of the independent variables are not known with certainty. Instead, each observation is represented by a multivariate Gaussian pdf ...
0
votes
1answer
17 views

How to choose an appropriate maxdepth in rpart.conrol?

I'm using the boosting method in adabag library and trying to choose an appropriate maxdepth in rpart.control for building a 2-class classification model using my training dataset. I have noticed that ...
0
votes
0answers
16 views

Exponential distribution of interval censored data MLE using optim on R error

I have a set of data which is interval censored and I wish to calculate its maximum likelihood error using optim. This is my code: ...
1
vote
0answers
56 views

testing interaction terms in regression model [duplicate]

Based on domain knowledge and preliminary variable selection, we have decided a set of 10 variables as predictor variables for building regression models. What are the general approaches to identify ...
2
votes
1answer
51 views

Linear regression with an inequality constraint

I am looking for an efficient way of finding a linear fit $Mx = y$ subject to an inequality constraint: $\frac{|x_2|}{\sqrt{x_3^2 + x_4^2}} \geq a$, with $a \geq 1$. The rectangular matrix $M$ is ...
0
votes
0answers
14 views

Graphing GEE Models in R?

I am currently working on a biological dataset where I am attempting to fit a detection function (Detection probability as a function of distance). I have been using the package geepack (in R-studio) ...
0
votes
0answers
4 views

Splitting and iterative simple regression in r [migrated]

I am pretty much new to r and I have a dummy example of a bigger table underneath. I want to split the table based on id variable (a,b,c,d) and do iterative simple linear regression for every subset: ...
0
votes
0answers
29 views

Using lmer for random effect and nested interpreting model comparison

I'm trying to do a lmer in r. I did an experiment in which I manipulated the temperature. My dataframe contains the following factors: Site: 11 level, random Species: 2 levels, fixed Subject: 10, ...
1
vote
0answers
27 views

Forecast of spot electricity prices

I recently started a job in power trading. But due to a sudden change in employment I am required to work on econometric models to gauge the supply and demand side of national power markets. So ...
1
vote
1answer
24 views

comparison of forecasting models for daily data (frequecy=365)

I have 852 days of daily attendance data and need to use the first 800 days data to predict the next 52 days and match it with my actual values. How do i decide which is the best model to use for ...
0
votes
0answers
25 views

R gam() throws error: “Can't correct step size”

I am computing a GAM on a large set of data sets. Almost all of them work, just this one data set makes gam() throw an error. I paste a code that reproduces this error here: ...
0
votes
0answers
29 views

Meta-analysis: design mixed-effects model in R

this is an example of my dataset: ...