Tagged Questions

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

1
vote
1answer
22 views

Logistic Regression using fractional polynomials in R

I have been developing a model based on trauma data of head injury in the UK. The key outcome is 30 day mortality (denoted as "Survival" measure). In a dataset of 2134 patients, there are other ...
0
votes
1answer
14 views

quantile regression with e.g. gamma distribution and log link

I have a basic question about quantile regression (I'm new to it): Why doesn't it seem possible to do a quantile regression with a specified family (e.g. gamma) and link function (e.g. log), as in a ...
0
votes
0answers
5 views

GAM-style effects plots for interpreting qrnn model

how to analyse GAM-style effects plots for interpreting qrnn models. I couldn't quite understand it from R documentation.
0
votes
0answers
10 views

Compute Transition Matrix

I am studying Markov Chain. I want to compute transition matrix. Is this the right way to do it ...
1
vote
0answers
17 views

What do the dip test output parameters mean?

This may sound like a silly question, but I'm not a statistician, mathematician, or programmer, really. I did quite a bit of googling, including looking into Stack Exchange, but couldn't find a clear ...
0
votes
0answers
4 views

How to plot the US maps with selected locations (longitude and latitude of the locations are known)? [migrated]

I've been struggling with the following R plotting of the US map and wonder if any of you have suggestions on how the plot should be done. Here is what I have tried: ...
2
votes
1answer
35 views

Maximizing likelihood versus MCMC sampling: Comparing Parameters and Deviance

I am working in R. I use lm() for maximizing the likelihood in the first analysis, and STAN to sample from the posterior in a second analysis. ...
1
vote
0answers
12 views

Interpreting output from cvFit(), understanding cross-validation in classification tree model

I am trying to understand how to interpret the output for cvFit(). The data is from UCI's ML repository. This is my model ...
0
votes
0answers
8 views

Y axes on the logit scale and centered in gbm.plot [migrated]

I am currently exploring the gbm functions in the package dismo to create boosted regression trees for species distribution modeling. I have been using the dismo vignettes as well as the 2008 paper "A ...
0
votes
0answers
9 views

Determining the “dominant” color in an image with R [migrated]

I am hoping this is the right place for this question. I want to know if with R, its possible to sample images, and determine their dominant color? If so, could you point me towards a package?
0
votes
0answers
3 views

r- pnn- error in smooth function

enter code hereI'm using pnn package. Here's an example of my table. I've converted everything to numeric except for the class, that is a factor. head(todo6) ...
1
vote
0answers
22 views

Fit a VAR model with R

I have a bivariate time series z_t where z_1t is the change in monthly US treasury bills (maturity 3 months) and z_2t the inflation rate,in percentage, of the U.S. monthly consumer price index ...
-1
votes
0answers
13 views

Cran Package from Google for Forecasting multivariate time series [on hold]

Recently, i saw the package that can forecasting multivariate time series and evaluate the effects of variables like promotion at main time series. Please help me to find it again
1
vote
0answers
26 views

How to determine if GLM quadratic term should be set up orthogonal or non-orthogonal

I am setting up a GLM in R where I have only one predictor variable and its quadratic form. I understand that in R I have 2 options. ...
2
votes
1answer
59 views

How can I remove multicollinearity from my logistic regression model?

I am working on Sales data. i have binary variable win/loss the opportunities and rest are the activities done by sales force (sales guys) with 40+ variables (different types of activities done for ...
-2
votes
0answers
13 views

connecting 2 columns into 1 + change to numeric not working [on hold]

I am trying to run some R code for loading data from files and than do some trails with pair trading. this is my code: ...
1
vote
1answer
20 views

Why does the null deviance in glm.nb differ between models of the same response variable?

I'm struggeling to understand the topic of deviance. Let's have two models as follows: ...
1
vote
1answer
28 views

How to analyze elastic net fitted model coefficients

SOLVED: an elastic net model, as any other logistic regression model, will not generate more coefficients than input variables. Check Zach's answer to understand how from an (apparent) low number of ...
3
votes
2answers
214 views

Analyze scatter plot

I want to study the relationship between two variables. I've got the following scatter plot. But now I'm hesitating on what to do with this: Should I check the assumptions of OLS and then use the ...
0
votes
0answers
14 views

R: Analyze scatter plot [duplicate]

I want to study the relationship between twe variables. I've got the following scatter plot. But now I'm hesitating on what to do with this: 1) Should I check the assumptions of OLS and then use ...
0
votes
0answers
29 views

Changing reference level/re-leveling contrasts changes results in non-convergence

I have a question regarding re-leveling in lme4 1.1-7. Experimental Design: Our experiment is an eyetracking while reading study (single sentence stimuli). We are analyzing four different ...
0
votes
0answers
8 views

selecting genes specific/agnostic to condition

I have a microarray transcriptomics experiment. The design of which is something like this : ...
0
votes
1answer
32 views

Extracting slopes for cases from a mixed effects model (lme4)

I would like to extract the slopes for each individual in a mixed effect model, as outlined in the following paragraph Mixed effects models were used to characterize individual paths of change in ...
0
votes
0answers
4 views

In R, how to create contour plot where lines indicate elevation and color indicate magnitude of a separate value? [migrated]

My specific example: I have a dataframe, say 'df', containing columns of x coordinates, y coordinates, elevation, and I have a vector of precipitation values associated with the x/y coordinates (say ...
1
vote
0answers
28 views

Can anyone provide a peer reviewed reference for the calculation of least squares means as implemented in the R package lsmeans?

I am using the lsmeans package from the R programming language for follow up analyses of a linear mixed model. However, my target journal does not generally use these methods and I would like to have ...
0
votes
0answers
3 views

Query() function within the 'lsa' package [on hold]

Does anybody have a link or an example to how one can input a query (e.g. a string of text or comma-separated words) and return a collection of matching documents by ranked "score" / return documents ...
0
votes
0answers
4 views

cvFit mean predicted error interpretation for nls models

I have been using the cvFit() function of the cvTools library in order to test my models (nls() ones), but I would like to know more precisely what the cvFit() returns to me when it's done. It only ...
1
vote
1answer
11 views

In R: How do 'centralization' measures of the STATNET and iGraph package handle disconnected networks?

I am working with about 300 disconnected of different sizes. I calculate different graph-level centralization measures for these networks using the STATNET and iGraph packages in R. However, I find ...
1
vote
1answer
47 views

Why can't the chi squared test be calculated with a row of zeros?

I have some trouble to calculate chi squared statistic with R. My data and code are: ...
1
vote
0answers
13 views

Creating a treatment group to measure uplift in sales for an advertising campaign

I have sales by state and week. Alabama|Alaska|Arizona|... 231|139|277|... 256|154|307|... 267|160|320|... 256|154|307|... 267|160|320|... I need to create a treatment group that bunches up the ...
0
votes
1answer
27 views

How to obtain index of a vector? [on hold]

This should be a quick question, but I've been stuck on it for quite some time... I was using the function predict in R package "rpart", and the function returns a vector that looks like below: ...
1
vote
0answers
19 views

auto.arima and Arima (forecast package)

I am facing a strange issue with auto.arima. On a dataset named data, I run the following code ...
1
vote
1answer
54 views

What are some useful robust and scalable approaches towards anomaly detection of a time series data?

What are some useful robust and scalable approaches/methods towards anomaly detection of a time series data? I am mainly looking for some practical approaches carried out using Python, R, Java, etc. ...
1
vote
0answers
17 views

How do I read in columns from a file with R [migrated]

I have files of the following format (just numbers, nothing else): ...
0
votes
0answers
14 views

> str(“discoveries) returning chr ”discoveries" [on hold]

> str("discoveries") chr "discoveries > str(discoveries) Time-Series [1:100] from 1860 to 1959: 5 3 0 2 0 3 2 3 6 1 ... I'm going through IPSUR and I'm ...
2
votes
1answer
16 views

Getting to predicted values using cv.glmnet

I'm a little confused by the predict function with a cv.glmnet object. I'm running these two lines: ...
0
votes
1answer
27 views

Missing factor levels after logistic regression glm()

I am quite new in the R universe, so please excuse me if the question is too simple.. I would like to perform a logistic regression on a marketing data set (only categorical variables), of the form ...
1
vote
0answers
17 views

Putting generated data in a matrix format [migrated]

I have one question about putting a simulated data in a matrix format, but I cannot suitably write its program in R, and constantly receive an error, I guess my "rep" definition and final "Matrix" ...
0
votes
0answers
10 views

Best statistical method to answer relationship - User Participation Groups

I am working with large data set. In the data set we have user participation (some metric), their expert level and group they are belong to. ...
1
vote
0answers
27 views

“weight” input in glm.nb function in R. How exactly does the weight affect the likelihood?

I would like to understand how the weight argument of glm.nb is affecting the likelihood function. I understand that glm.nb find the MLE in an alternating iteration process where for a given theta the ...
1
vote
0answers
23 views

GAM model has lowest GCV and highest deviance explained but factors are not significant

As my subject suggests, I am running GAMs (in package mgcv) with sighting data as dependent and a variety of environmental and time parameters as predictor variables. I am running a hurdle model, so ...
1
vote
1answer
41 views

R large glm with sample weights

I have a "stacked panel" data set with ~600,000 rows. While the data are compiled from a survey , the data are no longer in survey format: rather, these are person-year observations for ~100000 ...
0
votes
0answers
46 views

weighted likelihood of logistic regression [on hold]

Let $X_{ij}$ matrix np , $Q_{ij}$ and $N_{ij}$ matrices np . $y_i$ is the response $\in$ (0 or 1) , $y_i = binom(1,p_i)$ considering logistic model $logit (p)=\beta_0 + ...
1
vote
1answer
33 views

Definition of ARIMA with exogenous regressors in R

I am wondering about the exact definition of ARIMA model in function arima() in R when exogenous regressors are included. I ...
0
votes
0answers
25 views

How exactly does `R` define ARIMA models?

I have trouble understanding the output of function arima() in R. Reading the help file and other sources has not helped ...
-1
votes
0answers
15 views

R package for geographic regions [on hold]

Someone told me about a R package with the definition of objects some regions and nations boundaries. I'm trying to find the border of Veneto, an italian region. What's the name of the package? Do you ...
0
votes
0answers
5 views

Daily time series forecasting by item in R? [migrated]

I have a collection of sales data by item in this format ...
-1
votes
0answers
26 views

Queries in GBM Model in R

I have the following questions pertaining to GBM Model in R. Question 1 : I have a mixture of factorial and numerical data. And Its a binary classification ...
-2
votes
0answers
17 views

Forecasting in R X Axis [migrated]

Good day How do I change the x axis so that it shows the year and month? At the moment the x axis doesn't look right and comes up with 2014.0, 2014.5 and 2015.0. I want to use the forecast package ...
0
votes
0answers
6 views

How to specify that the model must include a particular independent variable in r package glmulti

I am trying to find the best model(lowest AICc value) using the package glmulti in r. This model must include TVIS as an independent variable but I am unsure how to specify this in the script. ...