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

0
votes
1answer
17 views

Interpretation of log(1 + var) transformed predictor

Interpretation of log transformed predictor neatly explains how to interpret a log transformed predictor in OLS. Does the interpretation change if there are 0s in ...
0
votes
0answers
4 views

Spearman correlation optmization

I need to compute Spearman correlation between two vectors. One vector is fixed, the other depends on k variables. I need to find set of variables {l1..lk} so that Spearman correlation is maximized. ...
1
vote
1answer
17 views

Changing the sequence of variables in a random forest model changes the classification accuracy

I find that the classification accuracy of the random forest model changes when the sequence of the input variables change. E.g. ...
4
votes
1answer
108 views

Understanding QR Decomposition

I've got a worked example (in R), that I'm trying to understand further. I'm using Limma to create a linear model and I'm trying to understand what's happening step by step in the fold change ...
0
votes
0answers
18 views

Richness presence bacteria

I need to find the richness, dominance and diversity about the presence of a bacterial population in different treatments. Is possible to make the calculation about the richness, dominance and ...
3
votes
0answers
41 views

Maximizing log-likelihood in R

I am trying to perform ML estimation for a continuous distribution given by \begin{align} F(x;\Phi)=\left(1-e^{-\eta^{k}(x)}\right)\left(1+\lambda e^{-\eta^{k}(x)}\right), \quad x > ...
0
votes
0answers
10 views

R - Variation of “How to plot decision boundary of a k-nearest neighbor classifier” [on hold]

This is a question related to How to plot decision boundary of a k-nearest neighbor classifier from Elements of Statistical Learning? I've been playing with that example, and would like to try to ...
0
votes
0answers
24 views

How to do an analysis of variance?

I ran an experiment in which probands had to rate (1 = dislike, 2 = like) how much they liked each of five fruits (apple, peach, orange, banana, strawberry). I now have results: ...
0
votes
1answer
38 views

Non parametric analysis

The my dataset is not normal distributed. In order to apply a non parametric analysis, exist only the Kruskal Wallis test or others? I need to find a test similar to ANOVA to apply a dataset not ...
0
votes
0answers
17 views

Calculating Cumulative Hazard Function [on hold]

Why are not hazard.km and quantile.km functions working in R ? ...
1
vote
1answer
34 views

Need help selecting appropriate statistical method for animal study

I could use some help deciding on the proper statistical method for a current experiment. The experiment is setup as follows: Independent Variable: Diet (4 groups of 10 for a total of 40 animals) ...
0
votes
0answers
10 views

How do I conduct model validation with glm models that have proportional response variable?

I would like to determine which environmental factors influence turtle nest survival. I ranked glm models with AIC using a step-wise procedure. The response variable is the proportion of eggs that ...
0
votes
0answers
13 views

Error Output - Wrong model type for regression

I am trying to constructs an Learning Vector Quantization (LVQ) model. ...
0
votes
1answer
11 views

R: Coping with bad model fit convergence during bootstrap

I'm running into trouble while checking the robustness of a GLM using the bootstrap procedures in R. Basically I want to check whether the estimated coefficient estimates of an existing GLM that I've ...
0
votes
0answers
4 views

Collapse duplicate rows by median value in R [migrated]

I have a date frame with two columns. I would like to remove rows where there are duplicate entries in the first column. however I would like to select a specific row to remain based on the value of ...
0
votes
0answers
12 views

Data importation, manipulation & calulation on list of pairs [on hold]

I have a 'complex' problem to face: 1) I have to import in R a text file ('from_soft') which is shaped like that (output from an external software) : ...
0
votes
0answers
70 views

What does the following ACF curve mean ? (Picture attached)

I was checking for seasonality and other dependencies and this is the curve I get . There's no apparent seasonality....but what exctly does the falling slope mean? Any help would be appreciated. ...
0
votes
0answers
17 views

Cointegration in R - Standard error, test statistic and p-value of weights

I'm using urca package in R version 3.2.1. I used ca.jo function on a set of I(1) regular time series variables - taking two at ...
0
votes
1answer
22 views

Correlation coefficients of a time series

I have 100 simulations of an ARMA(1,2) process, created with R is such a way: ...
0
votes
0answers
7 views

Is a Mixed type III anova appropriate for unequal N data? How does one run this analysis in R?

I have a dataset from a psychological experiment that consists of three repeated measures of responses to different kinds of items 'variable', as well as two between-subject IVs, 'condition' and ...
1
vote
0answers
15 views

R square change for 2-way interaction model

I want to test a regression model with neuroticism as focal predictor, agreeableness as moderator and RT variability as dependent measure (covariates: attentional control and mean RT). Previously, I ...
0
votes
1answer
12 views

One main effect and one interaction in R using multiple regression, is that possible? And why am I getting two interaction terms in output?

I have two factors that are fully crossed, the levels of the factor are each coded 0 and 1. I am running a regression testing for one main effect and one interaction. The following is my logistic ...
0
votes
0answers
17 views

Time-series cross-sectional classification problem

I have a time-series cross-sectional dataset consisting of 100 individuals that each had 4 features measured yearly for 21 consecutive years. One of the features is binary and the other three are ...
0
votes
0answers
17 views

Understanding ANOVA for comparison of models in R. Why is the result the same regardless of model order?

I'm trying to figure out why the anova function in R gives me the same results (for the p-value) regardless of the order of the models. ...
0
votes
1answer
21 views

GAM : choosing the a function for each predictor

When using GAM methods for prediction: $y = af_1(x1) + bf_2(x2) + cf_3(x3)... $ Where $x_1,x_2.. $ are predictors / features used in the data. The gam package in R helps us find the best functions ...
1
vote
1answer
64 views

Goodness of fit in R

I need to check for goodness of fit using K-S test in R. I have a dataset (containing 50 data points) and a non-standard continuous probability distribution. Should I peform a one-sample or two-sample ...
4
votes
1answer
71 views

Why areny my 95% confidence intervals symetrical around the mean?

I am trying to calculate the 95% confidence intervals around a mean value using a bootstrap procedure, from the mosaic pacakge, to deal with some assumption issues in my data. The code below seems to ...
0
votes
0answers
17 views

Regression model for Cumulative data in R

I am having a daily data for 3-4 months and another variable which is the cumulative sum. It starts with some value on the first day and it keeps on adding and at the end of 3 months, it would be sum ...
0
votes
0answers
17 views

Is there are better way of solving this problem than using a Neural Network Regression Model?

I'm working on power plant time series data from a SO2 absorption process and my main objective is finding out which independent variables are critical for reducing SAG (% of SO2 concentration ...
0
votes
0answers
12 views

Parallel processing in R saving plots [migrated]

I have a code in R to perform classification and estimation( using regression modeling) on 60 data sets using random forest algorithm and at the end of it there is a plot to show how a quantity ...
0
votes
0answers
12 views

Why the Brier Score's better when probabilities are estimated through PAVA instead of Platt Scaling?

I've been studying (and applying) SVMs for some time now, mostly through kernlab in R. ...
2
votes
2answers
37 views

Exact formula Yates' correction in R

If I run a chi square in R with the Yates' correction, I get slightly different results from doing it by hand. What is the exact formula R is using for the Yates' correction? I use the simple code: ...
0
votes
0answers
9 views

Correlation is moderate but Path coefficients (in pls-sem) show insignificant results

I am performing PLS-SEM analysis (usng plspm package), the outer loading's are significant as CI do not include zero on any of them However, large number of path coefficient's (i.e, inner model)are ...
0
votes
1answer
20 views

Simulate ARIMA Model in R using same starting values as original time series?

I have built an ARIMA model in R with the forecast package's auto.arima() function. I want to simulate the ARIMA model with the same starting values as the original time series. For example, if my ...
0
votes
0answers
6 views

Regarding pattern recognition and forecasting next set of sequence [on hold]

I have been working on use case where I have some sample data as below : Date Device Name Time Facility Code 1/6/2015 Tablet X 16:18:48:168 22 A 1/6/2015 Tablet X 16:18:50:41 ...
0
votes
0answers
19 views

How can I find the variance components from a MCMCglmm output?

I have a dataset in which birds (n=55) were measured twice for five different behaviours. I am now trying to statistically test if individuals are reapeatable/consistent in their behaviours or not. I ...
0
votes
1answer
22 views

Simulation of time series with R [on hold]

I'm new on time series. I'm trying to solve an exercise on the simulation of an ARMA process. The problem is the following: Generate 100 simulations, each with n=60 elements of an ARMA(1,2) process ...
0
votes
0answers
6 views

Package ‘JPSurv’ - Trends in incidence rates [on hold]

Has anyone ever used the JPSurv package in R to look at trends in incidence rates? The original software put out by the NIH - Joinpoint - is not compatible with my computer (a macintosh) and so I ...
0
votes
0answers
8 views

Error when using Irlba function in R? [on hold]

irlba(A=X, nu=2, nv=2) Error in matrix(0, m, m_b) : non-numeric matrix extent In addition: Warning messages: 1: In min(m, n) : no non-missing arguments to min; returning Inf 2: In min(n, m) : no ...
2
votes
1answer
26 views

Bars or Boxplot

For my thesis work I need to plot data as dry mass content, Brix, sugar content, etc., of 12 genotypes of onions. My question is, what is convenient to use, barplots or boxplots? Personally I like ...
0
votes
2answers
31 views

R - Multivariate K-nearest neighbor outlier detection

I'm trying to implement the algorithm K-nearest neighbor to detect outlier from a multivariate dataset. I don't know how to do it. Could you provide me some example?
1
vote
1answer
20 views

How to check if the correlation between two continous variables is influenced by a categorical factor?

I have a data frame (df) where I see correlation between two continuous variables (c1 and c2). I need to know whether the observed correlation between the two variables differs between groups, which ...
0
votes
1answer
39 views

what does the minus sign mean in the function definition in R [on hold]

I am reading a tutorial and I found a function definition in R ...
-1
votes
0answers
10 views

Brand based aggregation Fundamental

I am looking to do brand based aggregation on our audience (Brand based clusters tell you what brands people like). I have the following data about our customers. ...
0
votes
1answer
53 views

Does p value below 0.05 in mvShapiro.Test mean multivariate normality or not?

I am performing mvShapiro.Test from mvShapiroTest package. I get ...
0
votes
0answers
28 views

Graph with 3 variables in R? [on hold]

I have some data with 3 variables: x = position y = length z = number Here is an example: x y z 12 40 8 13 40 8 14 40 8 15 40 5 16 24 9 I'd like to ...
0
votes
1answer
61 views

Improving a logistic regression model in R [on hold]

I have to devise a model in R, capable of predicting the type of a disease, which is a categorical dependent variable (three possible values), through several continuous and categorical, some of the ...
0
votes
0answers
7 views

Inverse probability weighting (IPW): standard errors after weighting observations

When using propensity scores for inverse probability weighting (IPW) the standard errors for the parameters in the regression model may be affected. I have seen several examples of people using ...
-1
votes
1answer
37 views

Normal distribution in R: Find the value of $x$ for $P(X=x) = c$ where $c$ is known

I have a normal distribution with parameters $\mu=750$, $\sigma=260$. I'm interested in finding the value of $x$ that satisfies $P(X=x)=0.001$ for both sides of the tail. How would I go about doing ...
0
votes
0answers
17 views

How can I extract a residual variance-covariance matrix in lme?

I have been using MCMCglmm in R to fit bivariate (two response traits) mixed models in R, but now I need to move to lme to account for temporal autocorrelation of the residuals. In MCMCglmm I can fit ...