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
0answers
1 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 ...
0
votes
0answers
2 views

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

I'll be working with data from an a 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 ...
0
votes
1answer
8 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). But i would like to use something like in python: ...
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
1answer
15 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
8 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 ...
0
votes
0answers
23 views

How to do multilevel classification using R

I am trying to do a multilevel text classification using R. Is there any package in R which I can use to do it? If not, then how can I proceed using the svm or ...
2
votes
1answer
42 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 ...
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
87 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: ...
0
votes
0answers
16 views

Detecting heterogeneity in groups

This is a mockup of a dataset I am currently working on: ...
0
votes
0answers
22 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
9 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 ...
2
votes
1answer
42 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 do you interpret Ordinal Logistic Regression output without an adjusted R-squared Equivalent (and additional clarifying questions)?

I've gotten fairly good at multiple linear regression recently, and I'm now trying my hand in ordered logistic regression -- but I'm having trouble analyzing some of the results. Anybody who could ...
1
vote
0answers
17 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
77 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
10 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
41 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 ...
0
votes
2answers
27 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
23 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
15 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
51 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
48 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
24 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 ...
4
votes
2answers
45 views

Absolute (i.e., not just relative) probabilities in chi-squared test for proportions

Why do the absolute probabilities affect the p-value of a chi-square test so much? For example: ...
0
votes
0answers
21 views

Problem with year as a factor GLMM

So I need to do a GLMM, I do it this way, with package lme4 glmer(y~x1+x2+x3+year+(1|x4),family=binomial In my data, year is a factor (4 levels). So when I run my glmer, I have my result like this x1 ...
0
votes
1answer
42 views

Transformation of latitudes to include them a linear model

I have in a dataset a variable latitude that contains values such as 39° 37' 39" N and ...
3
votes
1answer
109 views

Manually calculated chi-squared statistic differs from that given by chisq.test in R

I'm using R to do a chi-squared test on two sets of data to check if they follow a distribution. In the first case the chi-squared statistic given by chisq.test ...
1
vote
0answers
28 views

Fit a GARCH (1,1) - model with covariates in R

I have some experiences with time series modelling, in the form of simple ARIMA models and so on. Now I have some data that exhibits volatility clustering, and I would like to try to start with ...
0
votes
0answers
16 views

How to merge datasets in STATA conditionally? [migrated]

I have written a program which runs fine in R. But I need to convert it to STATA, in which I am relatively new. Since STATA allows you only to run a single dataset, I need to merge the data. My first ...
0
votes
1answer
28 views

Trying to use Holt-Winters to fit this data

I'm trying to fit the data in this message (daily temperatures) using a Holt-Winters technique in R, but can't get the seasonal example in here to work ...
0
votes
0answers
18 views

How to fit a model for a censored binary outcomes?

Suppose I have a data frame such that: ...
4
votes
1answer
23 views

Using log-linear models for presence/absence data in wildlife

I'm working on a project wherein I compare the presence/absence of a number of bird and herptile species between wetlands that have received three different treatments. The populations were surveyed ...
0
votes
1answer
29 views

Ways to simplify a neural network in R for interpretation

I would like to try to make some sense of a neural network. The neural network has a single hidden layer and is used on 30-40 attributes, which are used to classify the probability that the ...
-2
votes
0answers
25 views

denoising using R or matlab [on hold]

How can I use R or matlab to denoise data using the following smoothers 1) wavelet 2) epanechnikov kernel 3) polynomial spline 4) logistic kernel.
0
votes
0answers
18 views

What is the sampling design and how to declare it in the survey()

I have a sample design that can be resumed in: Split the city in X areas and, for each area, sample 5% of the residences and get some informations about it; For each residence, interview ALL ...
1
vote
0answers
22 views

Fit and predict logistic regression model for censored data?

Suppose I have a data frame such that: ...
1
vote
3answers
126 views

Monte Carlo integration help needed

I'm trying to simulate these two integrals using Monte Carlo simulation: $$ \int_{-\infty}^\infty \exp(-x^2) dx, \quad \mbox{and } \int_{-\infty}^\infty \exp(-|x|) dx . $$ When I use ...