Use this tag for any *on-topic* question that (a) must have an `R`-based solution yet (b) is not *just* about how to program in `R`.

learn more… | top users | synonyms

0
votes
1answer
12 views

How to do multivariate machine learning? (predicting multiple dependent variables)

I am looking to predict groups of items that someone will purchase... i.e., I have multiple, colinear dependent variables. Rather than building 7 or so independent models to predict the probability ...
2
votes
0answers
9 views

Nested ANOVA: Unequal sample sizes? Variance components?

I am completely out of my depth on this, and all the reading I try to do just confuses me. I'm hoping you can explain things to me in a way that makes sense. (As always seems to be the case, "It ...
0
votes
0answers
7 views

Prediction of returns and volatility in a Garch-model

I have a question about the prediction of volatility and returns of a time series. Basically it is a question about prediction in the ...
0
votes
1answer
16 views

Some Basic things we need to do when we are doing text classification

I am working on a project where I have to do multi-label text classification. I want to understand that whether my approach is correct or I am missing something. I am using R to do it. Clean ...
0
votes
1answer
14 views

Heteroscedasticity filter for time series

I am looking for a method or package in R that can remove heteroscedasticity from time series. Specifically, I have a number of time series to which I want to fit a VAR model. Each time series may or ...
0
votes
0answers
30 views

analysis of non-normal data

I collected some data on a species of goose called Brent Goose over the winter. A csv file of the data can be downloaded from Dropbox or imported straight into R with this code: ...
0
votes
0answers
18 views

Fitting a best fit line to this time series

I have the following hourly time series data and would like to fit a best fit line to it: There seems to be a periodicity on a daily basis and a weekly basis. By this, I mean there are patterns ...
1
vote
1answer
28 views

Building a time series model using more than independent variables

I am working on a project, and I am totally new to statistics. I have sales data for last two years at week level, along with other variables like temperature, holiday (TRUE/FALSE), where holiday are ...
0
votes
0answers
16 views

Popular implementations of one vs all logistic regression for mutiple classes in R

Is there any popular implementation of logistic regression in R that defaults to using a one vs all approach for a categorical dependent variable with more than two classes? I have specific reasons to ...
0
votes
0answers
12 views

Question about DIANA algorithm and plotting the result

I am using the diana() function in R from the "cluster" package to cluster some data. To plot the result I use pltree(): pltree(diana(data.dist)) So the problem is that I have 3 brances in one node ...
1
vote
1answer
44 views

Difference in AIC and BIC values between sem and lavaan packages in R

I ran the same SEM model in sem and lavaan. I got the same parameters and - generally - very close test values, with the exception of AIC and BIC which were immensely different between the two ...
3
votes
1answer
47 views

Not sure I understand how R calculates the covariance

Please forgive this silly question, I'm fairly new to statistics. Consider this R code: ...
0
votes
0answers
17 views

Cummulative Mixed Model in R variable names

I'm trying to fit a cumulative link mixed model clmm() in Rstudio. I'm currently having issues with the diagnosing what is wrong with my model from the output I am getting. The output I got from my ...
7
votes
2answers
109 views

How to properly handle Infs in a statistical function?

Suppose I have a function such like: f <- function(x){ exp(x) / (1 + exp(x)) } it's supposed to work for any real value of x, but actually it returns NaN ...
4
votes
0answers
24 views

R packages that work with biased samples

I'm working with a biased sample of web users. I'm only able to track responses of users who have navigated my site in a certain way, and I'd like to run an analysis to determine how certain factors ...
2
votes
0answers
11 views

Evaluate deviation from negative binomial model

I'm trying to figure out how to determine to what extent a sample deviates from a negative binomial model fitted to a larger population. As an example, I generated counts of doctor visits for a ...
3
votes
0answers
20 views

How can IRT-Models be understood in GLM/ SEM Framework? (Predict Learning with added Paradata-Covariates)

I'll be working with data from an intelligent tutor system similar to one studied in the KDD-Cup 2010 on student performance prediction and plan to use IRT models to infer item and ability parameters. ...
-1
votes
1answer
31 views

Cluster with distance threshold in R

I'd like to get clusters with a maximum inner distance threshold. Now I use hc <- hclust(d) and cutree(hc, numofclasses). ...
0
votes
0answers
11 views

Difference in memory usage between gbm and blackboost [migrated]

I'm working on a database with around 250000 observation and 50 predictors (some are factors so in the end around 100 features) and I have trouble using the blackboost() function (from mboost package) ...
1
vote
2answers
37 views

Dealing with different time series data in Machine Learning

I am trying to create a stock market model based on fundamental variables for the US economy. I am using R. Some of the variables I am looking to include are: GDP, Unemployment Rate, Initial Claims, ...
0
votes
0answers
9 views

How To Fix a Non-Representative Sample Using Ordinal Logistic Regression and Predict Appropriately?

After searching for this question, I did find this -- but it didn't seem to be asking the same question and I'd like to extrapolate on it if possible to get more into fixing it generally and the ...
2
votes
1answer
50 views

Can R substitute PRIMER efficiently and effectively?

Quite a simple question, looking to see if anybody has experience using both. I have no knowledge of PRIMER, but wondering if R (currently) has the same capacity for data analysis specifically for ...
3
votes
1answer
45 views

How to convert from Mann-Whitney U to Z (or other effect size)?

I'm looking at multiple studies. I do not have the original data. One study I'm looking at provides means, standard deviations, and Mann-Whitney $U$ values (with $p$). (How) can I convert from ...
0
votes
0answers
29 views

How Can I Make Sure All My .CSV Data Gets Imported as NA instead of Blank in R? [migrated]

In my dataset, I'm using have four assessments I'm trying to predict: 1 [Good] to 4 [Bad]. My model seems to be working using the polr function to predict values ...
2
votes
2answers
96 views

Why is the Pearson correlation 1 when only two data values are available?

I am trying to obtain a Pearson correlation between 6 different variables (represented by columns in the matrix below) with two datapoints each (rows). This is the matrix: ...
1
vote
0answers
21 views

Detecting heterogeneity in groups

This is a mockup of a dataset I am currently working on: ...
0
votes
0answers
27 views

simulating distributions with non-symmetrical confidence intervals in R

I have a software package that outputs estimates that have non-symmetrical confidence intervals. I am simulating these distributions for further Monte-Carlo estimates. In the below example I am trying ...
0
votes
0answers
10 views

Does Boruta feature selection (in R) take into account the correlation between variables?

I am a bit of a novice in R and feature selection, and have tried the Boruta package to select (diminish) my number of variables (n= 40). I thought that this method also took into account the possible ...
3
votes
1answer
47 views

Meaning of Qqnorm plot in R

I am testing the normality of a sample with R using qqnorm. I obtain this: I understand that the meaning of this plot is that the sample has fat tails. But what is the meaning of the values on the ...
0
votes
0answers
16 views

How to compare forecasting methods: based on ARIMA and curve fitting?

I'm making a project connected with identifying the dynamics of sales. My database concerns 26 weeks (so equally in 26 time-series observations) after launching the product. I want to make forecast ...
1
vote
0answers
19 views

How to Obtain “Right” Parameters of Multinomial Logit Model (or Other Conditional Models) in R?

I started to use the function multinom of R package nnet in order to fit several conditional ...
5
votes
1answer
83 views
1
vote
0answers
24 views

Plotting fitted values for an nlme model

I just got the output of my lme (nlme) model called shalit5 with syntax: ...
0
votes
0answers
10 views

Construct matrix of stacked variables in VAR regression

I am trying to NOT use packages for the estimation of models in order to have a deeper understanding of how things work. Currently, I am trying to estimate a VAR(1) (vector autoregression of first ...
0
votes
0answers
22 views

Help interpreting R linear model fit [duplicate]

I have observed variables power$values. I am trying to model this process using a second set of observations, such that $P = M\cdot X + B$. $P$ is the function ...
1
vote
0answers
12 views

lme / lmer - split-plot with Non orthogonal subdesign

I have an agricultural field experiment (testing a plant protection agent): Split plot design with: ...
1
vote
2answers
44 views

Understanding dummy (manual or automated) variable creation in GLM

If a factor variable (e.g. gender with levels M and F) is used in the glm formula, dummy variable(s) are created, and can be found in the glm model summary along with their associated coefficients ...
1
vote
2answers
33 views

what does the correlation of Random forest regression tool in R represent

I've built a random forest model (regression model) using randomForest package in R, and I calculate the correlation between the predicted values and the actual ones in order to know how the trained ...
0
votes
0answers
14 views

Lsmeans: Is this what I did?

after doing the linear mixed model with lme4, I have used lsmeans for pairwise comparison with this command: lsmeans(lmer52, pairwise~color, adjust="tukey") I am ...
0
votes
0answers
24 views

Fitting an ANOVA with too many predictors in R. No p-values but how can I still interpret the model?

So I've fit an ANOVA model to 32 predictors and 32 data points. The summary output simply gives me the SS for each predictor and no F-stat or p-value. Is there any way to still make some sort of ...
0
votes
0answers
29 views

How to do Regression Discontinuity Design in R [on hold]

I am having trouble with doing regression discontinuity design in R. Could anyone show me a syntax for R to do RDD? The exercise I have is y= wealth x=winning margin covarites= education, past ...
0
votes
0answers
30 views

Splitting factors in R [migrated]

I have a factor with values of the form Single (w/children), Married (no children), ...
0
votes
0answers
38 views

Converting factors to numeric values in R [migrated]

I have factors in R that are salary ranges of the form $100,001 - $150,000, over $150,000, ...
0
votes
0answers
16 views

What is the limit of variables that can be used in R to create matrix scatter diagrams? [on hold]

R crashes after trying to create a matrix scatter diagram with 47 variables that are in a CSV file being read by my R workspace. I have already set my limit number to NA by using limitNo=NA which ...
1
vote
1answer
53 views

Constants in a DLM Model R

Good afternoon, I am attempting to fit a state space model of the form: $$ (S_t- \mu) = G*(S_{t-1} - \mu) + E_t $$ $$ Y = F*S_t + v_t $$ Where $Y$ is nx1, $G$ is 3x3, $S_t$ is 3x1, $\mu$ is 3x1, and ...
0
votes
0answers
17 views

Calculate first difference by group in R [migrated]

I was wondering if someone could help me calculate the first difference of a score by group. I know it should be a simple process but for some reason I'm having trouble doing it..... yikes Here's an ...
0
votes
0answers
12 views

Nonempty Numeric vector? [migrated]

So I run this loop: (my data file is very big, .csv) ...
0
votes
1answer
50 views

I want to learn about ROC curve — what is the canonical textbook?

I want to learn about Receiver-Operator-Characteristic curves, and metrics. I have read through online webpages with some basics, and I have used MATLAB built-ins to create ROC plots. It tells me ...
0
votes
0answers
11 views

warning message from ezANOVA function in R [migrated]

I am new to R and I am trying to use ezANOVA to do a repeated measure factorial anova. So I have a data frame named mus.df, which looks like the following (with more rows): ...
1
vote
1answer
27 views

code needed for p values in GLMM

I need to get p values for the fixed effects in the following GLMM's I ran. Does anyone know of code that I can run that will give me the p values I need? At the moment the output from the ANOVA only ...