Questions tagged [r]

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`.

6,503 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
2answers
39 views

Coefficient Comparisons

I estimate two models using the same data: lm(Z ~ X, data = W) # Model 1 lm(Z ~ X + Y, data = W) # Model 2 I am trying to test whether the coefficient on X ...
0
votes
1answer
523 views

calculating p-value from PRE (proportional reduction in error)

In R, I have created a PRE value to test whether or not modelA is significantly different from modelC. How can I get a significance value for either the PRE distribution or the R^2 distribution (...
0
votes
1answer
715 views

Bivariate K function for inhomogeneous spatial point processes

I have some inhomogeneous spatial point patterns of individuals in a cactus population. I also have marks, such as "diseased"x "healthy" individuals, and "adult" x "juvenile". I've already computed ...
0
votes
1answer
1k views

Deleting Outliers in a regression model

Working on a linear regression problem in R, I created a first model flights_lm = lm(freq~dist+capa+nbrt+depf+lcco+prbi) where freq is frequency, dist is ...
0
votes
1answer
592 views

Adding observations by aggregating existing data

Question I'm aware that generating features from existing data can be a valid method for adding new features for a regression/ML algorithm*, but can you add observations generated from existing data? ...
0
votes
1answer
409 views

converting discrete values to buckets to perform predictions

I have a set of continuous discrete values, which I would like to convert to a classification task. Say, my scores in an exam are anything between 0-100. I want to convert my scores in the next exam ...
0
votes
1answer
833 views

bivariate normal distribution probability

We have two genes X and Y. Let $(X,Y)\sim N(\mu_x=9,\mu_y=10,\sigma^2_x=3,\sigma^2_y=5,\rho\sigma_x\sigma_y=2)$. To find $P(X+0.5<Y)$ the probability that the sample mean for the second gene ...
0
votes
1answer
468 views

Determine penalty parameter based on AIC values in lasso regression for linear mixed model

I have a dataset with 14 variables, of which one random effect (Patient) I fitted following code: "fit1_B2=lmmlasso(y=y,x=x.matrix,z=z,grp=grp,lambda=0.1,pdMat="pdIdent") summary(fit1_B2) fit1_B2$aic"...
0
votes
1answer
3k views

If the log-likelihood is negative, should we choose it? - model comparison

I am doing linear mixed models using lme4 and this is the results of model comparison: ...
0
votes
1answer
258 views

Test statistical significance of a trading strategy

I have created a trading strategy which operate every single day on the DAX 30, for the last 1700 trading sessions (some years). I have the daily returns of my strategy and also the daily returns of ...
0
votes
1answer
88 views

Data Mining, generating a model from a database

I have a database with different variables which contains information such as age, date of vaccination, number of doses as well as the number of antibodies (which is my target variable). If the number ...
0
votes
2answers
103 views

Which statistical significance test to use?

I have got the following population within a data.frame: ...
-1
votes
0answers
12 views
-1
votes
0answers
19 views

Creating the input for mcl algorithm

I would like to implement mcl (Markov clustering algorithm) in a dataset like this one: ...
-1
votes
1answer
44 views

Testing normality for residuals

I have an Randomized block design experimental set up and a data consisting of species abundance. I would like to test for normality of the residuals, as in unexplained variance due tot the blocks. I ...
-1
votes
1answer
40 views

Effect size for linear models

I´m running simple linear models in R y~x but always got a really small R², although the p-Value always shows significance!. Now I wanted to calculate an effect size because I want to know whether ...
-1
votes
1answer
24 views

Finding Average Treatment Effects through R

I am trying to determine the average treatment effect of a data set. The data set already has the outcome for each unit both under treatment and under control. How can we find the effect through ...
-1
votes
1answer
18 views

problem in finding the calculated auc and aupr values

This is the code for k-seeds clustering where features and side_effects are the excel files. I am facing problem in understanding the results. Where to find the calculated AUC and AUPR values? And ...
-1
votes
1answer
48 views

Detecting patterns in time-series data using R

I have a dataset of 258k observations with date time data for each observation in the format of %Y-%m-%d %H:%M:%S. Each observation is a social media post made by a ...
-1
votes
1answer
124 views

Confidence Intervals in ANOVA testing

I have read other posts before raising this question. I understood the mechanics behind Anova but I have not fully grasped its essence in logical terms. What I mean is that if I calculate the mean ...
-1
votes
1answer
276 views

cv.glmnet vs glm vs lm.ridge

I am currently trying to build a ridge regression model, and knows that the lm.ridge, glm and cv.glmnet functions can enable me to do so. However, I really do not know what are the differences between ...
-1
votes
1answer
253 views

Too many False Positives with Unbalanced Data

I am trying to predict customer churn in a telco company, using R.The dataset is very unbalanced, the target is around 0.6% of the base. 8,746 Customers will Churn 1,396,664 Customers do not churn I ...
-1
votes
1answer
144 views

Random forest fully fits training sample

Using the randomforest package in R, I am getting 100% accuracy on the training dataset. Here is a reproducible example : ...
-1
votes
1answer
23 views

I need to compare the responses of one group of participants to two different tests.

I need to compare the responses of one group of participants to two different tests. The answers that the participants had to provide on those tests were 1 CORRECT and 2 INCORRECT. For example, I have ...
-1
votes
1answer
92 views

How to derive formula from GLM coefficients?

I get the following coefficients from a logistic glm but need to convert it into a formula, i.e. Y= b0 + bx1 + bx2... My challenge is that the variables are discrete and each missing a category: ...
-1
votes
1answer
27 views

Pick a cluster for customer locations

On our app customer's visit stores. We would like to assign a City or location as the customer's "home" location, to offer him/her targeted offers. What we've done so far: Using R, we performed ...
-1
votes
1answer
46 views

can someone help to formulate the correct random effects part for nlme and lm4

below is a dataset (selection) with 4 persons (person), each measured 5 times (test) in 5 different situations (situation) for a certain response (value). I want the alternative of the linear model ...
-1
votes
1answer
89 views

Impact of features

How can I see the influence of the features in my model (e.g. what is the impact of a specific feature on the target variable)? Saw a great article (https://medium.com/applied-data-science/new-r-...
-1
votes
1answer
342 views

parametric quantile regression vs non-parametirc quantile regression

I am a little bit familiar with quantile regression but I was wondering what is the difference between parametric quantile vs non-parametric quantile. Also, the "rq" function is R is based on ...
-1
votes
1answer
153 views

Linear regression on percentages?

I am trying to formulate a model through simple linear regression of automobile sales dependent on GDP growth. I have the following data: Annual GDP growth in the affected countries as a percentage ...
-1
votes
1answer
40 views

Evaluating Groups Based on Multiple Variables

I have what seems like a simple question, but I've been trying to find a solution all afternoon with no luck. My dataset that includes a number of continuous variables, and two different grouping ...
-1
votes
1answer
234 views

2 questions about the functions in the `deepnet` Deep Neural Network package in R

I'm using R to perform the Deep Neural Network. But there are so many packages and functions related to neural networks that I am confused. I am wondering about the following two things. What are ...
-1
votes
2answers
683 views

Different results with repeated measure correlation (rmcorr) and cor.test

I did a repeated measure correlation (package: rmcorr) inculding two data points. But if I look also at the correlation separately for each point, I´m a little bit confused because the repeated ...
-1
votes
1answer
1k views

SVM kernel parameter and tunning parameter

In the svm function, you can apply three cases to the kernel parameter. "Linear," "radial," and "polynomia." And I try to derive the optimal svm result by ...
-1
votes
1answer
264 views

R multilevel analysis: my sample size (gender) is unequal

i'm currently working on a mutlilevel anaylsis for my assignment. I am new to R and hope that someone can help me out. I did a survey to collect the data I need. I have 184 participants, where ...
-1
votes
1answer
458 views

Generalized Linear model with python, using categorical data to explain continuous variable

I'm trying to model Mean Opinion Scores (MOS) about image quality, based on an image data base. The data base has 3000 images, it has 25 original images, 24 distortions of each one and 5 levels of ...
-1
votes
2answers
475 views

Auto.arima is not fitting the data well

I have two variables speed and vibration and you can see that speed causes vibration. I am trying to fit this using auto.arima. But when i plot the fitted model, it gives bad result ...
-1
votes
1answer
54 views

problem with linear regression

I made a linear regression multiple model, I've got all the parameters insignificant with high p value, I get this result: The variables are time series. Rates except Polity which is natural number ...
-1
votes
1answer
301 views

Clusplot and variability

I'm testing the clara algorithm with a dataset, but as we can see in the figure: I got the message "These two components explain 1.06% of the point variability" What can I conclude about this? The ...
-1
votes
1answer
47 views

How to determine which columns/values in a dataset/dataframe can be Predicted which cannot?

I have a data-set/data-frame with columns Description, Department Name, Priority, Doctor name & Location.Description data comes as free text from from the UI. Based on historical description's in ...
-1
votes
1answer
33 views

Need advice on classification.

I would be grateful if someone can provide some insight into classification. I have a data set which has a large number of feature > 5000 and 60 observations, with 13 classes. My data set has classes ...
-1
votes
1answer
3k views

Plot only OOB Error from RandomForest

I am using random Forest in R and only want to Plot the OOB Error. When I do plot(myModel, log = "y") I get a diagram where ...
-1
votes
1answer
555 views

What is a design matrix? How do I build a design matrix for Rasch analysis?

I am trying to do an LRSM Rasch analysis of 72-item data. This data has 67 binary items and 5 ternary items. I need to create a "design matrix" in order to analyze this data. I do not really know what ...
-1
votes
1answer
361 views

Clustering algorithm for categorical data

I have a data-set with data in following format: Basically, data represents whether a particular word is present in that file or not. So say If file with doc-id 1 contains word1 then we put 'Yes' ...
-1
votes
2answers
91 views

How to define clustering in R

The data contains information about the genes causing breast cancer in our body. My aim is to find the most effective gene on breast cancer in our body. The code that I have first divides my sample by ...
-1
votes
1answer
5k views

How can I calculate utilities for attribute levels in conjoint analysis in R?

I conducted a stated preference survey in which each respondent had to choose 1 set out of 3 choice sets (A, B and C), which are characterised by 4 attributes (let's say brand, color, size and ...
-1
votes
2answers
226 views

Fitting parameters of a function

Imagine a graph where the x-axis is time in minutes (continuous) from 0 to 360. And the y-axis represents 'z' values. Of this continuous time course graph, I have 8 time points w/ their corresponding ...
-1
votes
1answer
2k views

Which are the basic steps of the stock price forecasting using ARIMA model in R?

I am very new to this field and I want to learn forecasting of stock price using R. Please let me know which are the step should I follow? If someone know tutorial links for forecasting in R then it ...
-1
votes
1answer
1k views

Outlier detection with ROBPCA for multivariate poisson/non-normal data

It is stated here[1] that we can use ROBPCA to detect outliers for multivariate data. After reading the manual ([2] page 12 : "multivariate normal model etc."), I think the ROBPCA method is also ...
-2
votes
0answers
27 views

Convert R's rgamma random sampling to Python scipy's gamma.rvs

Is there a way to translate from R's rgamma(MSamples, shape = kA, scale = thetaA) gamma random distribution, to Python scipy's ...