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

0
votes
0answers
13 views

Handling Sparse Data Frames - algorithm selection

I am new to machine learning/statistical modelling. I am trying to run a classification on a highly sparse dataset with 100 features, most of which are categorical (TRUE/FALSE) with the remaining ...
1
vote
0answers
15 views

How to simulate a random variable from a matrix variate distribution?

I am trying to simulate a random variable from the matrix variate normal distribution but have not seen any literature on it. If somebody could point me in the right direction for that or if they ...
0
votes
1answer
22 views

Optimization failure in HoltWinters [on hold]

I am using HoltWintersto fit the exponential model on the data. The data shows trend as well as seasonal pattern.Getting the following error message: ...
0
votes
0answers
8 views

R: Error with mlogit Conjoint modelling - system singularity

I am building choice models on a dates about coffee preferences. I have 5 alternatives: Brand, Cup, Price, Certification and Local Community Support. The data looks like this: ...
1
vote
0answers
24 views

R - Number of days since last occurrence [migrated]

I have a data frame that looks like this: ...
-1
votes
0answers
15 views

Adding number of observations in a histogram using gglpot [on hold]

My dataset looks as follows: ...
2
votes
1answer
47 views

How to implement model in R?

i would like your help to implement this model in R or more explicity where yt = monthly mean values μi = mean value in month i, i = 1 . . . 12 . I1;t = Indicator series for month i of the ...
-1
votes
1answer
20 views

Rearrange boxplot with ggplot [on hold]

My data looks as follows: X=cbind(var1=rbinom(100,1,0.26),var2=rbinom(100,1,0.01), var3=rbinom(100,1,0.07),var4=rbinom(100,1,0.09),var5=rbinom(100,1,0.004)) If ...
0
votes
1answer
8 views

Permutation on multiple Pairwise Comparison with least square means in R 3.1.2

I'm working on a study where I employed an analysis of covariance (Ancova) with unbalanced factors. I used permutation tests to obtain p-values for my estimates since my observation does not come from ...
1
vote
1answer
31 views

How to use a linear model with two factors and repeated measures?

Suppose I have a date set of the form: ...
0
votes
0answers
13 views

define prior probabilities in naive bayes with unbalanced classes and asymetric cost

I'm trying to apply Naive bayes to the following supervised problem: It's a binary classification problem The classes are unbalanced. The target class represents the 0.004266432 of the total and the ...
1
vote
0answers
19 views

Survival Analysis on Telecom Churn in R

I am working on Telecom Churn problem and here is my dataset. http://www.sgi.com/tech/mlc/db/churn.data Names - http://www.sgi.com/tech/mlc/db/churn.names I'm new to survival analysis.Given the ...
0
votes
0answers
7 views

Error: could not find function “rxGetOption” in Revolution R Open [on hold]

I downloaded and installed Revolution R Open. Current Version of R is 3.1.1 (2014-07-10) -- "Sock it to Me" and version of Revolution R Open is 8.0 beta. I have started basic tutorial from converting ...
0
votes
0answers
6 views

In R, using glm to model call counts in treated/not treated forests [on hold]

Ok, so I'm new to using R and trying to learn this on my own because my uni doesn't have a prof who uses R. I've tried googling for answers, and I feel like I'm sort of getting answers, but I'm still ...
1
vote
0answers
26 views

Comparison and testing multinomial coefficients

Straight to the problem I want to test the hypothesis that two coefficients of multinomial regression model are equal between them. For example, considering a model where Y is 3 level categorical ...
0
votes
0answers
24 views

Forecasting a solar data using arima in R [on hold]

I have a solar data collected from a PV plant for the period 2009.the method for forecasting as suggested for me is to use a training set for instance from 01/01/2009 to 30/04/2009 and a test period ...
1
vote
0answers
24 views

Is there a way to add covariates to centile GAM curves in R?

Using the package "mgcv" I fitted a GAM to demonstrate head circumference changes over the lifetime for data stemming from two different countries; ...
0
votes
0answers
19 views

nlme estimates near zero variance for the random effects

I am doing various analysis on a small sample. Basically, we have an experiment where 14 subjects (UID 1 ~ 14) used one of the 6 instruments (MID 1 ~ 6) on 3 occasions (Sequence 1 ~ 3). Each time an ...
1
vote
0answers
15 views

How to plot model with forecasts in R? [migrated]

I recently upgraded R from 2.x to 3.1 and I feel like there were some changes that I am not aware of with regards to plotting models. ...
0
votes
0answers
7 views

Why does aov consider a 3x3 factorial design unbalanced?

I have a two factor, bot at 3 levels with all factor levels, and with 5 replicates for each. This is a standard 3^2 factorial design, and yet aov gives the message "Estimated effects may be ...
0
votes
0answers
24 views

Making a neural network model more sensitive to one of its several inputs

I am currently using neural network methods in R to model energy consumption (response) based on temperatures, previous consumption values and weekend dummy variables (inputs). Unfortunately, the ...
0
votes
0answers
19 views

Please help me about Dunnett's test in R [on hold]

I have got a problem about the test of Dunnett's test.Why I cann't run the results. I cannot understand it.Please help me and thanks for the answer.
0
votes
0answers
20 views

Techniques for comparing two windows of data in a time series

I'm working on a small independent project in R, trying to make my own (very crude) forecasting method. The general idea of the component that is giving me trouble is trying to compare two windows of ...
0
votes
0answers
6 views

Rate table in package survexp.fr in R [on hold]

I would like to calculate the similar parameters produced by SMR(...) in SURVEXP.FR package. The question that I have is if I ...
1
vote
0answers
5 views

Linear mixed model construction validation

I have 6 groups of fish made up of 8 individuals. Each group is tested three times under different treatments. These group level treatments are hungry , ...
0
votes
1answer
25 views

R times series — correct use of forecast() and accuracy() in forecast package

Cross-posting this from Stack Overflow, because it's a bit of a stats/ technology cross-over. I'm relatively new to R and the forecast package I believe authored by Rob Hyndman. I'm having trouble ...
0
votes
1answer
41 views

Proportions Test for when one sample has lots of zeros

I tried using chi-squared test, but it is giving me odd results, For example: Let's say that I am testing whether behavior between male and female users is the same. Males only bought 3 units of ...
0
votes
0answers
29 views

Comparing medians from two groups

Hi: I have a survey where respondents were asked to rank a series of statements in terms of how much they agreed with them. There were seven statements. So, for each of seven statements, each ...
1
vote
1answer
16 views

Mixed effects model for power function data

I have data which I suspect follows a power function over time. It is collected from several units which have different intercepts. Therefore I'd like to do a mixed model with the parameters of the ...
0
votes
0answers
15 views

Dealing with non events in one treatment group - survival analysis

I am currently trying to apply survival analysis to several tree species which were monitored for growth and phenology for 4 years and seperated into three treatment groups. From this data I have ...
-1
votes
0answers
29 views

False rejection rate of simulated values in R [on hold]

I need to create a table of Estimated Rate of False Rejection of Null Hypothesis in testing at the Nominal $0.05$ level for selected $n$ and $k$ in simulating values from the Gamma Distribution with ...
1
vote
1answer
41 views

Multiple Linear Regression Variable Selection

Using all possible subsets we consider the adjusted $R^2$, Akaike's Information Criterion (AIC), corrected AIC ($AIC_c$), and Bayesian Information Criterion. The model with the highest adjusted $R^2), ...
1
vote
0answers
22 views

Using A Time Series To “Scale” Another

I know the "average theoretical cost per impression" for Jan 13 - Dec 13. I have other monthly time series for "total # of impressions", "total # of clicks" and "total number of conversions" for Jan ...
0
votes
0answers
12 views

How to calculate y predictor based on ANCOVA estimates? [duplicate]

My formula looks like this: lm(formula=BearWeight ~ honey + age, data=BearData) my output looks like this I am told to interpret each estimate and then use the estimates to predict the weight of a ...
0
votes
1answer
16 views

Vectorise Within-Groups Sum of Squares in R

I've got a multivariate dataset (p=2) that I'm trying to calculate the W matrix for use in canonical variates analysis If each $x_{kj}$ is the jth observational unit from the kth group, and ...
0
votes
0answers
26 views

KNN Regression in R - using KKNN package [on hold]

I have been trying to figure out how to plot a multiple regression for a training set with the K(KNN regression). The package name is KKNN for R. The line below expresses the multiple regression model ...
1
vote
1answer
28 views

Comparing two sequence objects?

Using TraMineR, is it possible to compare two sequence objects to calculate the discrepancy between them? By this I mean not comparing two sequences but two sets of ...
0
votes
0answers
11 views

individual level random effect for over dispersion

In glms we can use a quassipoison fudge factor to account for over dispersion in our poisson models. In glmms we can add an individual level random effect (e.g. ...
1
vote
1answer
50 views

Customizing a graph with gray regions

I'd like to do a graph similar to this one with the gray regions to point the recessions in my graph. I have R and Excel and Stata, I'm simply trying to make it easy to distinguish the recessions by ...
1
vote
0answers
38 views

Package ‘randomForest’ R defining variable importance in advance

I am planning to build 5 successive random forests (RF) on a same data using r 'randomForest' package. I am leveraging work done as per the page. while building the first RF, each X variable should ...
0
votes
0answers
3 views

nonuniform box plot in r [migrated]

Background: I have data that is bursty and non-uniform in time. I am making boxplots of the data Problem: The boxplot in r is placing them uniformly distant. I would like to place them at an ...
0
votes
1answer
18 views

Correlation of change in expression with response variable

I have paired gene expression data before and after a treatment, as well as an ordinal response variable with 3 levels for each sample after treatment. I am interested in the correlation of the ...
0
votes
0answers
17 views

R ivreg command vs. manual 2-stage method

What is the difference between the ivreg command in R and doing the IV regression by hand in two stages? The estimate is the same, but the standard error is not the ...
0
votes
0answers
6 views

interpreting the clogit output in R

Maybe this is obvious but I've never done a conditional logistic regression before. In the clogit output after the Rquared value there is a max possible value. I assume this is max possible Rsquared, ...
0
votes
0answers
13 views

VAR model for price forecasting in multiple time-series context. How to get “real figures” as forecasts?

Sorry for the rather long introduction, but since I was (legitimately) critizised for not explaining my cause and questions enough, I will do so now. I would like to conduct a (price)-forecast based ...
0
votes
0answers
22 views

Repeated measures linear mixed effects model

I am working with trees that were fertilized in a full factorial design (N x P x K) in plots that are replicated four times. I currently have a mixed effects model with this structure: ...
0
votes
0answers
11 views

handling trend in predictor and response variable

I am trying to create a linear regression model containing two predictors and 1 response variable. My response variable has a short term pattern, i.e. surge during weekdays and slump during weekends ...
1
vote
1answer
15 views

How to get random classification to assess the performance of classifier with McNemar test?

I'm trying to replicate a study where the author used the McNemar test to assess the performance of classification compared to random classification. I have the original classifier and I'm using R to ...
0
votes
0answers
22 views

regarding skip the intercept term once it is not statistically significant [duplicate]

After building the regression model, the intercept value is not statistically significant Is that reasonable to just skip it in the final regression model?
0
votes
1answer
52 views

How to do MANCOVA in R?

I have two groups of persons, GRP0 and GRP1, on which I measured three continuous variables: VAR1, VAR2 and VAR3. I would like to use Mancova in R with: - VAR1, VAR2 and VAR3 as outcome variables - ...