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
1answer
26 views

Plot that shows which attribute has the most effect on class?

I'm playing around with two datasets: Mushrooms and Breast Cancer. I'm trying to form a hypothesis of which attribute would have the most effect on the class when making predictions about the class. ...
0
votes
0answers
14 views

Is there a non-parametric repeated measures test for replicated block data?

Following on from an earlier question, I've got another question about comparing machine learning classifiers on various datasets. From the response to that question, and also to this paper I ...
0
votes
0answers
15 views

Unsuccessful ML estimation of a modified Weibull model's parameters

I'm running this code in R to find the ML estimators of a modified Weibull model. ...
0
votes
0answers
12 views

Log returns and ARMA-GARCH models

I try to model currency rates volatility using GARCH models through the RUGARCH package in R. Starting from the observed currency rate series, I compute the log-return through: ...
0
votes
0answers
66 views

How to calculate probabilities based on cumulative of time series?

I am trying to do predictions on plant growth based on cumulative of time series data. Unfortunately I am not a statistician, just a programmer tasked with writing the application that does this (PHP ...
1
vote
1answer
25 views

Calculating spline curve with custom knot positions

I want to fit a spline curve to a simple dataset in R featuring a single custom knot, and extract the resulting models. The data is: ...
3
votes
1answer
77 views

Monte carlo simulation in R

I am trying to solve the following exercise but I actually have no clue on how to start doing this. I've found some code in my book that looks like it but it's a completely different exercise and I ...
0
votes
1answer
32 views

Recommenderlab - Getting the user_id out the RealRatingMatrix containing UBCF recommendations

I'm trying to use recommenderlab (with RSTUDIO) to get recommendations.When I'm using UBCF I can't extract the user id out of the realRatingMatrix containing the predictions, although I can do it with ...
0
votes
0answers
42 views

How to evaluate the optimal cutoff of ROC curve related to logistic regression using roc from the R package pROC?

I would like to get the optimal cutoff of an ROC curve relating to a logistic regression. I am using the roc from the R package pROC. I am assuming same cost of false negative and false positive using ...
0
votes
0answers
20 views

Transition probability matrix negative values of an M/M/C in R

I am trying to calculate a transition probability matrix of an M/M/C in R. The information given is the following : An IT support help desk represents a queuing system with five assistants taking ...
0
votes
0answers
23 views

Is my nested random-effect model non-hierarchical?

I have a problem with model structure because of the way factors are nested in a potentially non-hierarchical way. I'm not sure if I fully understand the issue but I can't find a way to specify the ...
0
votes
1answer
24 views

Modeling error structure in lmer in R?

Is it possible to add a parameter to lmer model which will be modeling the error structure? Sth similar to TOEP(X) and SP(POW) from SAS???
0
votes
1answer
19 views

From a normal distribution concerning tv rating to its profit distribution

I'm following a Quantitive Methods Course, we have been asked to solve 12 questions from an harvard business case concerning tv ratings. Intro: The questions: I've already answered the first 10 but ...
1
vote
1answer
15 views

Distance from hyperplane in SVM rbf kernel in R

I am running ksvm in R(using kernlab package) for a highly imbalanced data.Is there any way i can get the distance of my test data points(each of dimension 8-10) from the hyperplane?so that i can ...
0
votes
0answers
13 views

RandomGLM: data (responses) is not read as numeric [closed]

I'm relatively new to R and I have a problem with randomGLM for prediction of a continuous variable. I read in four datasets which are comprised of a training ...
1
vote
0answers
23 views

Expected survival time from log-logistic survival model in R from survreg

I'm currently estimating a survival model (accelerated failure time model) with a log-logistic distribution in R using the survival package and the survreg function. I want to simulate expected ...
0
votes
0answers
16 views

Beta linear model

I wanted to learn more about the Beta linear model for data analysis. I was wondering if there were any good books out there to help code this model in R and to learn more about the Beta linear model. ...
0
votes
0answers
8 views

Fitting several growth models using grofit vrs nplr?

I have having a tough time fitting a a series of grow models to a fairly simple dataset. I'd like to fit several growth models and compare using AIC or some other model selection method. However I ...
0
votes
1answer
50 views

Cronbach's alpha in R

I am pretty new to Cronbach's Alpha, so I have a question about how to find it using R. As far as I am aware, Cronbach's alpha is a measure of internal consistency, but to use the alpha() function in ...
1
vote
1answer
26 views

Cohen's Kappa in R with no results

When I use the Cohen's Kappa coefficient to measure the inter-rater agreement between two rates, I cannot get the results. Here I provide a mock example to show the results. Please note that one rater ...
1
vote
0answers
10 views

Retaining variables in dcast in R [migrated]

I am using the dcast function in R to turn a long-format dataset into a wide-format dataset. I have an ID number, a categorical ...
10
votes
2answers
141 views

r-squared in quantile regression

I am using quantile regression to find predictors of 90th percentile of my data. I am doing this in R using the quantreg package. How can I determine $r^2$ for ...
0
votes
0answers
3 views

Calculating Model's Classification Accuracy in R [migrated]

I want to calculate the classification accuracy for a model I am fitting using glmer. Here is what I am doing: ...
0
votes
0answers
15 views

How to determine the random variable distribution to fit the generalized linear model in R? [closed]

I have a trouble with a sample from a random variable. I cannot determine its distribution. I would like to calculate the generalized linear model then with this variable treated as the dependent ...
3
votes
0answers
34 views

Why is glmnet giving me different answers than ridge estimation

I'm using glmnet to calculate ridge regression estimates. I got some results that made me suspicious in that glmnet is really doing what I think it does. To check this I wrote a simple R script where ...
0
votes
0answers
22 views

find best fitting model from GLM output

after running biglm on the data I am a bit confused regarding the output. I normally use GLM and so the biglm output looks rather different. A summary of the object outputted by biglm is ...
2
votes
0answers
46 views

Mixed-effects: length of the experiment as a continuous fixed effect?

I have measurement of nitrogen uptake Nup across 4 different SITE very far from each other and in different years (e.g. ...
3
votes
2answers
120 views

Do the residual plot and QQ plot look normal?

I am doing linear mixed model and would like to check the assumptions using residual plot and QQ plot. Here is my code: ...
0
votes
0answers
11 views

How to add weights to bestglm() [closed]

I am trying to run a best subset regression using the bestglm() package in R, but am having trouble adding weights. According to the bestglm() package pdf, there is a weights specification in the ...
0
votes
0answers
19 views

How to Force Split Decision Tree in R

Is there any ways that a user can force split the decision tree in R ? I just think when building decision tree, we may need expert judgement in order to obtain the final model. As far as I know, ...
1
vote
1answer
28 views

Practice problems for linear and non linear regression [closed]

I am new to statistics and am developing an interest in learning regression analysis. To be more precise, can you point me to some online resources where i can find real world data sets and regression ...
0
votes
0answers
37 views

Calculating average Spearman's Rho from Pearson r values (meta-anaylsis) [closed]

What is the meta-analyzed coefficient, or mean Rho, of the following set of data. What type of estimate is this and what other information might you need for a more sophisticated procedure? Case ...
0
votes
0answers
15 views

Interpreting a repeated-measures two-way ANOVA in R

I'm not sure if I've structured the model correctly, and if I have, I'm struggling to interpret the output I get anyway. I had 40 respondents exposed to 4 groups of stimuli - let's call the groups a, ...
3
votes
0answers
50 views

How to calculate p-value using an algorithm on R assuming that distribution is unknown

For a given sample x, where x is distributed with a normal distribution mean known but variance unknown. I am testing the hypothesis that variance is equal to one or greater than 1. The question is to ...
0
votes
0answers
11 views

How to add an attribute to any level of objects (list, list\$frame, list\$frame\$column)? [migrated]

My problem is as follows: I'm trying to write a function that sets a collection of attributes on an object in a given environment. I'm trying to mimic a metadata layer, like SAS does, so you can set ...
1
vote
0answers
8 views

How to recombine seasonally decomposed stl components in R [migrated]

I want to recombine the seasonal components to the seasonally adjusted components for a time series that is decomposed by stl. For example: ...
-1
votes
0answers
13 views

How can we specify a customized lambda to glmnet [closed]

I am new to the glmnet package in R, and wanted to specify a lambda function based on the ...
0
votes
0answers
11 views

R, probability, pbinom [closed]

According to literature, the average colony forming unit for my experiment is 23 CFU. I have 8 media plates. What chance is there that I can conclude from the 8 plates that the CFU is 20 or higher? ...
0
votes
0answers
21 views

Absolute Loss in R

I have been asked to compared between Robustness of absolute lost regression and its variants compared to least squares. I have done the least squares should I use Lasso now? ...
1
vote
0answers
22 views

How to analyze the effects of air pollution separately for the warm season and the cool season

In the model for main effect, we used the R code: ...
4
votes
1answer
112 views

What does my ACF graph tell me about my data?

I have two datasets: My first dataset is the value of an investment (in billions of dollars) against time, each unit time being one quarter since Q1 of 1947. The time extends to Q3 of 2002. My ...
0
votes
0answers
14 views

Nonlinear mixed effects model proportion data

I'm working on proportion data (clutch success: number of hatch eggs over total clutch size) which is non normally distributed. I would like to fit a nonlinear mixed effects model with 6 fixed effects ...
0
votes
1answer
42 views

Probabilistic classifier useful for both numeric and nominal features

First, I should say I'm beginner in data mining and use Matlab. I have a huge dataset: approximately 40 millions observation. It consists of 24 features including numeric and nominal values like ...
5
votes
1answer
34 views

How factor one variable in a large model in r? [closed]

I apologize in advance if the question is duplicate. I have 100 variables as predictors, in which 1 variable is categorical, like 0 or 1. I want to factor this variable in the model. The problem is, ...
1
vote
0answers
26 views

Problem with multivariate lognormal distribution in R

I'm using the R package compositions for the multivariate lognormal distribution. this is the only package I found that supports it. However I'm not sure how this ...
2
votes
0answers
29 views

Multi-​​step fore­casts with­out re-​​estimation for weekly data [closed]

I am trying to replicate the code written by Prof. Rob on Multi-​​step fore­casts with­out re-​​estimation for weekly data. How to write the below code for weekly time series data? I have weekly data ...
3
votes
0answers
12 views

chi-squared test vs fisher's test vs … => highly unbalanced length frequency data

I would like to statistically verify if two distributions are identical. Basically, the first distribution is a length frequency distribution from a large population ("population"). The second is the ...
2
votes
2answers
55 views

estimating the value of a property (real estate) using the hedonic regression

I'm trying to estimate the value of a property depending on the property characteristics. I did some research and I found out, that it would be better to use the Hedonic Model/Regression instead of ...
2
votes
0answers
29 views

Causal Impact R Package

We’re doing some advertising tests with test and control groups very similar to the example in the Google Research Causal Impact publication except we’re doing state tests and not DMA. I just have a ...
0
votes
0answers
36 views

Negative Binomial Regression model; algorithm did not converge

I am using R to run some negative binomial regression models. For model 1 I have the number of network in-degrees as the dependent variable, and Twitter followers, friends and number of Twitter ...