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
0answers
15 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. ...
1
vote
0answers
18 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
11 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
10 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
20 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 ...
0
votes
0answers
9 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
16 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
4 views

selecting genes specific/agnostic to condition

I have a experiment. The design of which is something like this : g1 Sample1 Sample1 Control1 Control1 Sample2 Sample2 Control2 Control2 g2 g3 . . . gn I wanted ...
0
votes
1answer
20 views

Extracting slops 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 ...
0
votes
0answers
22 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 [migrated]

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
2 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
0answers
8 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
44 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
26 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
18 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
37 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
15 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
18 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
9 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
24 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
22 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
39 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
45 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
31 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. ...
0
votes
0answers
29 views

estimating LMM with r

Suppose I have a model $$\begin{bmatrix}y(1)\\y(2)\end{bmatrix} = \begin{bmatrix}\mu \\ \mu \end{bmatrix} + \begin{bmatrix}\Lambda \\ \Lambda\end{bmatrix} + \begin{bmatrix}\varepsilon(1)/\rho_1\\ ...
3
votes
1answer
31 views

“weight” input in glm and lm functions in R

I am confused with the definition of the weights in glm and lm. Using the McCullagh and Nelder (1989)'s notation, If random variable $y_i$ is from the Generalized Linear Model (GLM), then its density ...
0
votes
0answers
5 views

Comparing structure of disconnected networks of different sizes

I am trying to figure out a way to evaluate and compare the structure of multiple (600+) disconnected networks of different sizes (from 31 to 5000 nodes). From what I have read in the literature, ...
0
votes
1answer
35 views

How to interpret ANOVA output when comparing two nested mixed-effect models?

I've got two models (all variable are count variables): ...
2
votes
0answers
15 views

Some questions about AlgDesign for Fractional Factorial Design in R

I have a few Design of Experiment type questions about the AlgDesign package in R that I can't find answered online: Will using the center=TRUE option in the ...
0
votes
0answers
24 views

clustering analysis of large amount of time series

I would like to cluster a set of time series, which are composed of around 50000 different time series. Are there established algorithms/package that can handle this scalability problem?
0
votes
0answers
3 views

Rserve connection from local R client to Rserve host on AWS Server [migrated]

Currently trying to connect to an Amazon AWS server via IP address on port 6311. I've set up Rserve as a daemon on the AWS server and have checked that it is in fact listening on port 6311 by calling ...
1
vote
0answers
36 views

Confidence interval for differences in total sums

I have data from two variations of an ecommerce web site and would like to determine the confidence interval for the difference in generated profit between the variations. My data contains both the ...
1
vote
1answer
35 views

Using the same variable as a fixed and random effect in Mixed Effect Models

The experiment this data comes from an experiment where two people collaborate to put objects in a specific order. The Direction has the target array on their screen, and the Matcher has a scrambled ...
1
vote
2answers
97 views

Determine when time-series should be logged (or any other transformation) and applied automatically

Is there any way to test whether a series should be logged or transformed in another way? I have a code of which i use to run lots of different data through to forecast. Some of the data definitely ...
0
votes
0answers
36 views

R Logistic regression model - Error

I'm trying to run following command in R, but I'm getting an error ! any one could help and explain a reason for that ? ...
1
vote
1answer
38 views

Power analyses of 5 populations of infection data (binomial data) [duplicate]

I am PhD Biologist. I have 5 populations of infected moth larvae (3 inbred, and 2 outbred). The infection in this case is spread vertically (from mother or father to offspring). Normally the virus is ...
0
votes
1answer
28 views

AR(2) & constant & trend - very poor constant estimates?

Here is a problem that was puzzling me. Suppose I simulate the AR(2) process with constant and trend using the code below (I apologize for inefficiency and inelegance - the aim was to get job done at ...
0
votes
0answers
4 views

R Fuzzy Membership function is not working correctly [migrated]

I have a two dimensional dataset and I want to calculate a score for the degree of membership of a new datapoint to that dataset. For this purpose I thought of using the membership function used in ...