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
27 views

linear or poisson regression for monsoon onset

I was interested to know if I have historical data of onset of monsoon every year (where onset for each year is in Julian day) and I want to do a regression of onset against time to study whether the ...
0
votes
1answer
68 views

mixed effects model output

lets say we have this: model2 <- lmer(milk.amount~(1|cow), data=milk, REML=FALSE) model1 <- lmer(milk.amount~(1|cow), data=milk) summary(model2) Linear mixed model ...
1
vote
1answer
46 views

Standardized beta for logistic regressionin R

For my survey data analysis, I ran an Ordinal Logistic regression using the 'polr' function. The summary of the regression is as follows: My question is: Do I need to standardize my beta values? ...
0
votes
0answers
42 views

Multiple regression analysis

I have a data set based on 14 field sites, the dependent variable I am investigating is count data recorded at each site (on 3-5 visits). The independent variables (I have around 45) are fixed at ...
0
votes
0answers
49 views

Is this a case for an ordinal logistic regression? Problems interpreting output

I'm a beginner in statistics and R, sorry if this question may seem trivial. I've collected data measuring several different parameters in 40 subjects at two time-points (t1 and t2). There are 3 main ...
0
votes
0answers
21 views

logistic regression using probabilities of class labels

My goal is to train a logistic classifier. My samples in my dataset have some label noise but for each label I can give a probability how correct this label is. What is the best way to incorporate ...
1
vote
0answers
32 views

Repeated measure two-way ANOVA (non-parametric)

Non-parametric ANOVA – a hot topic that is unanswered. There are many questions on this topic online. However, they all seem to end in a debate and no definite answer or clear explanation (that I ...
0
votes
0answers
35 views

ANOVA to find subjects that responded significantly different between treatments

I have a dataset composed of several subjects exposed to two different treatments (treat) in three distinct times (test), and I am interested in highlighting which subjects have significantly ...
1
vote
0answers
23 views

Rank problem in inversion of t(A) %*% A in R [migrated]

I need to get the inverse of the cross-product $(\mathbf{A}' \mathbf{A})$, and I run into numerical problems that don't make any sense to me. I actually need $(\mathbf{A}' \mathbf{W}^{-1} ...
0
votes
2answers
50 views

Significance factors

How can I determine a significance factor? For example, If 1/1 samples returns positive, the ratio is one. However, if 9/10 samples return positive, the ratio is .9, but is better because of the ...
4
votes
0answers
48 views

How exactly is the sum (or mean) centering constraint for splines (also w.r.t. gam from mgcv) done?

The data-generating-process is: $y = \text{sin}\Big(x+I(d=0)\Big) + \text{sin}\Big(x+4*I(d=1)\Big) + I(d=0)z^2 + 3I(d=1)z^2 + \mathbb{N}\left(0,1\right)$ Let $x,z$ be a sequence from $-4$ to $4$ of ...
4
votes
1answer
65 views

Working with residuals of regression

So the background is that the I collected yield data for past 5-6 decades and location from where I collected yield data had high yielding varieties introduced over time. I am looking at the ...
2
votes
1answer
40 views

Differences in AUC calculation between pROC and ROCR

Does anyone know the difference in calculation between these two AUC packages? They get different results when I add in positives with predicted value of 0 (simulating a prob model where many outputs ...
0
votes
0answers
16 views

R: boxplot of 2 columned table [migrated]

My input is: 4 a 2 a 3 a 5 b 4 b 1 c 5 c 8 c I would like a boxplot of a, b, and c. How do I convert the above into something I can boxplot?
6
votes
2answers
144 views

Clustering a noisy data or with outliers

I have a noisy data of two variables like this. ...
0
votes
0answers
5 views

Error when trying to export randomForest model to PMML [migrated]

I'm receiving an error when trying to export one of my 'regression' randomForest models to PMML. The code I'm using to generate the model looks something like this: ...
1
vote
0answers
26 views

combining and contrasting time course GLMs using R

I am analyzing some time course data in which I have set up a GLM using R for each subject. Each GLM I want to run is an attempt to extract estimates of different behavioral conditions effects on the ...
0
votes
2answers
55 views

Why does ca.jo has a minimum lag order of 2?

I am trying to use urca library to do cointegration test, and its function ca.jo, which conducts the Johansen procedure on a given data set. I think a lag order of 1 is possible for a cointegrated ...
1
vote
1answer
119 views

Smoother lines for ggplot2

This question probably has a simple solution, still the thing is I've written a code to plot mortality in 2 different groups and that is, death in obese patients vs not obese. Now their are 2 groups ...
0
votes
0answers
20 views

Beta-t-EGARCH model, what is the unconditional variance

I am trying to implement Beta-t-EGARCH model in R, however, I fail to understand what is the unconditional variance of this model. I know for simple GARCH model, unconditional variance is ...
3
votes
1answer
63 views

SVM in R package e1071

I am trying to use SVM to make a prediction (True or False) on a dataset with many independent variables. I am wondering how I can identify the most useful variable in making the prediction. I ...
0
votes
0answers
23 views

Leave-one-out cross validation in selecting predictor

I am a newbie here. There are 155 total samples. Five different predictors Xi (i=1,2...5) are used to predict Y, like X1 X2 X3 X4 X5 Y .... The objective is to find the best predictor Xi to ...
0
votes
0answers
48 views
0
votes
0answers
22 views

Multivariate multiple moderated regression

My Dissertation analysis method involves a Multivariate multiple moderated regression. Where I have 4 Dependent Variables (DVs) and 4 Independent Variables (IVs). My model 1 is testing main effects ...
0
votes
2answers
44 views

Multinomial logistic regression with geepack in R

I am working on fitting a GEE model to a multinomial logistic outcome using the R package geepack. My understanding is that the package uses ...
3
votes
1answer
47 views

What resolution should I be using for residuals vs fitted values plot from a linear regression?

I made this linear regression that shows how well estimated animal locations (longitude) predict actual animal locations. ...
0
votes
1answer
32 views

kernels and similarity (in R)

I am trying fit different kernels to calculate similarity matrix in R. Here is example data - X matrix : ...
1
vote
1answer
31 views

How to explain the large p.value difference between these two models

I fit two gee models with two different correlation structures, exchangeable vs ar(1), which resulted in very different p.values. I'm wondering what reasons have led that. Would somebody offer an ...
0
votes
0answers
7 views

The best way to analyze repeated measures from limited subjects?

I realized there are options to analyze repeated measures like anova, gee, mixed model. Here I have a challenge situation like only 4 measures from 10 subjects. I'm wondering, if I have to, what the ...
2
votes
2answers
287 views

How to transform a normal random variable such that I can simulate normal samples between the range of 1 and 45?

How to transform a normal random variable such that I can simulate normal samples between the range of 1 and 45? Do I need to do a jacobian transformation ?
0
votes
2answers
30 views

Running logistic regression on survey data

I have a survey data which has one dependent variable ("Overall experience") and several independent variables(Quality of food, creativity of menu etc.). The response scorecard for both dependent and ...
2
votes
2answers
102 views

Two-Sample t-Test for Equal Means with unequal variances for large samples

How can I perform a two sample test of means with unequal variances for a very large sample in R? In case of large samples the statistic will asymptotically follow a normal distribution. Which R ...
0
votes
0answers
12 views

Can I include future index into current forecasting in R models

I am new to R. Now my team is building forecasting models for monthly sales. Our sales correlates quite well with a industry index. As a forward index, we can get both past 5 years' index and next 3 ...
-1
votes
1answer
27 views

Weighting related attributes in hierarchical clustering

I have two questions about output of hierarchical clustering and improving the output. I'm trying to learn more about performing hierarchical clustering in R so I started looking at a simple dataset ...
3
votes
0answers
47 views

Classical or robust variogram for incorporation into generalized linear model [migrated]

I'm modeling counts of organisms over time at eleven locations. I'd like to account for temporal autocorrelation in the counts, assuming it's present. As the data are not equally spaced in time, ...
1
vote
1answer
38 views

R Error in chol.default(A) krigeST from gstat package

I am working with an hourly dataset of air temperature, recorded at ~200 stations over a relatively small area. I chose a space-time variogram (e.g. sum-metric) to fit my data and am now trying to ...
0
votes
0answers
28 views

Multinomial logistic regression interpretation in R

I have run a multinomial logistic regression test for the interaction between species of deer, days a camera trap was in the field and type of reaction. The model with the best AIC value was: ...
1
vote
0answers
16 views

How to specify binomial glmm with random and correlation in R?

I am working on developing a model with a binomial response variable. My data consist of GPS points from tracked animals. The data set is large and contains 15,000 observations from 40 individuals. I ...
0
votes
1answer
71 views

Difference between prediction in R and SQL

I'm working on a prediction model for a continuous variable (amount of medicine injected) .I use R for modeling.My project flow is to multiply the prediction of a glm (logistic regression) model that ...
2
votes
1answer
46 views

How to create a nearly orthogonal experimental design in R?

Does anyone know an R package for nearly orthogonal designs? I would like to create an experimental design, using 12 runs, up to 10 factors, and with mixed levels (e.g. a combination of 2 and 3 level ...
1
vote
1answer
23 views

divergence between nls (simple power equation) on non-transformed data and lm on log transformed data in R

I'm testing different ways to fit a simple power model to a dataset of 5 points. I don't get same results if I use nls on non-transformed data or lm on log10 transformed data in R whereas Excel ...
0
votes
0answers
23 views

R multinomial logistic regression interpretation

I have run a multinomial logistic regression test for the interaction between species of deer, days a camera trap was in the field and type of reaction. The model ...
0
votes
0answers
19 views

Complete interpretation of Cox regression output in R

I need help with complete interpretation of this output(below). Can someone explain all (almost all) estimators in this output: what they mean and what is the substantive interpretation. In ...
2
votes
0answers
15 views

Plotting means in R [migrated]

I want to fit my vectors x ,y to some kind of curve, but they're both about 10k long with x-values very closely packed, so a scatter plot just ends up as a huge mess. What I'd like to do is to plot ...
0
votes
0answers
56 views

Arima function doesn't consider seasonal components

Currently trying to fit several models to some data sets in order to find an accurate enough one, I ran into some difficulties with the Arima function of the ...
0
votes
1answer
30 views

GLM with categorical predictor on R

I need to do a model with a generalized linear model. My data are these: habitat : 0 or 1, group : 1 or 0 , mortality : yes or no, and the numbers of individuals for each case (habitat, group and ...
0
votes
0answers
26 views

Entire data considered as support vector

I am currently learning to use support vector machine as classification. I have a data set with 161 observation and 18 dimension. I get 160 support vectors using svm function form R package, e1071. ...
1
vote
1answer
84 views

calculating probability or filtering that certain subject is not in the particular cluster

I have a situation where there are n individuals and p features (variables). I do have their cluster information. Here is an example: ...
1
vote
1answer
37 views

How to calculate the robust standard error of predicted y from a linear regression model in R?

How can I calculate the robust standard error of the predicted y from a linear regression model in R? Any suggestion is appreciated.
0
votes
0answers
20 views

Cross-validation and R

Consider the following data set train: z a 1 1 0 2 0 1 1 3 0 1 1 2 1 1 0 3 0 1 1 3 with binary outcome variable z and predictor variable a. ...