Questions tagged [r]

R is a free, open-source programming language and software environment for statistical computing, bioinformatics, and graphics.

Filter by
Sorted by
Tagged with
1
vote
2answers
70 views

Handling NA Values in the Chicago Crime Rate data set

I am doing a little project on the Chicago Crime Rate data set and I noticed that there are over 600,000 NA values, primarily in the location fields. I feel that ...
1
vote
0answers
109 views

reproducible results by set.seed

Is it possible for results to fluctuate a little bit even if I set set.seed? Kindly comment on the degree of freedom allowed or the possible standard deviation from the result set if seeds are fixed? ...
1
vote
1answer
46 views

Classification model to classify large number of classifiers?

Hello I am very new into the field of machine learning/deep learning , and I am finding it hard to select the right model for my research. What I am trying to build is a model to classify which ...
1
vote
2answers
36 views

Calculate regression coefficients for individuals (low sample size regression)?

Is there a way to calculate the regression coefficients for individuals instead of just a group resp. calculating regression coefficients for a very small sample size? Background My goal is to test ...
0
votes
0answers
24 views

E-step for EM algorithm for document clustering

I have a code for the E-step in the EM algorithm for Document Clustering in the version of hard-EM algorithm. I'm trying to implement the E-step for soft-EM algorithm. Here is my code for Hard-EM: <...
0
votes
2answers
2k views

Compound Annual Growth Rate Function in R Statistics

I need to calculate the compound annual growth rate for two periods of time: 2014 & 2009. I'm currently working with Excel, I have two columns with data for each year (One column with only data of ...
1
vote
0answers
29 views

Fastest way to parse regex in R

I need to parse around 1.6k REGEX expressions such as the pair I am writing below. I have also around 7k documents (1/2 page long each in average) that need to be parsed according to the REGEX ...
1
vote
1answer
14 views

Differerent ways to detect the appropriate number of topics

I implemet the LDA topic modeling in R. One essential parameter is the selection of the number of topics Which of the following ways could it be the most suitable: ...
3
votes
1answer
58 views

Alternative to VGAM for Zero Truncated Negativ Binomial GLM in R

Is there an alternative to the vgam Package to do a zero truncated negativ Binomial GLM in R?
0
votes
1answer
27 views

How to create a barplot using multiple column [closed]

My data is about boardgames which contain 1 to many catgeories each like this : ...
0
votes
0answers
13 views

Importing A Neural Network From Mathematica For Use In R

I am experimenting with platform interoperability between Mathematica and R. My aim is to create an untrained Neural Network using Mathematica, export this network in MXNet format as a .json file, ...
0
votes
1answer
449 views

Correlation Matrix Issues: Can't Convert Variables to Numerics

QUESTIONS: Can you tell me how I can convert int and factor variables to numeric variables in R? Can you tell me why ...
0
votes
1answer
31 views

What is RFormula in simple English?

Question Is R Forumula is to train a linear regression model? If a response value "cancel probability" is a function of (age, height), then R Formula is to generate a model (w-age, w-height, ...
2
votes
1answer
43 views

Machine learning dataframe dimension concept vs NumPy dimension

From Machine Learning for Absolute Beginners: A Plain English Introduction: Contained in each column is a feature. A feature is also known as variable, a dimension or an attribute - but they all ...
1
vote
2answers
81 views

I want to be able to collapse and sum values dependent on the gene name

I have a table that looks like this: I want add together all the values for each gene for each column. For example, for LINC01128, it should read: ConN1 ConN2 ConN3 StN1 StN2 ...
3
votes
1answer
25 views

Identify members who are likely to switch where they receive drug administration

I have access to medical claim data from a large health insurance company. As some of you may know there is a large delta between the price of drug X depending on where it is administered. My ...
1
vote
2answers
27 views

Sort a data frame column based on another sorted column value in R

I have a data frame that is sorted based on one column (numeric column) to assign the rank. If this column value is zero then arrange the data frame based on another character column for those rows ...
1
vote
1answer
22 views

Random Forest in R with only character variables

I am new to using random forest in R an my goal is to identify the independent variables which have the highest impact on the dependent variables. I am looking at sales data, and sales is my dependent ...
51
votes
10answers
80k views

IDE alternatives for R programming (RStudio, IntelliJ IDEA, Eclipse, Visual Studio)

I use RStudio for R programming. I remember about solid IDE-s from other technology stacks, like Visual Studio or Eclipse. I have two questions: What other IDE-s than RStudio are used (please ...
4
votes
2answers
2k views

Constrained k-means algorithms in R (must-link constraints)

I currently face an unsupervised learning task that is to be approaches using clustering. More specifically, it is a segementation task and hence there is some prior knowledge about a) the number of ...
0
votes
2answers
396 views

How to mask or crop IDW results

My question is: how can I mask or crop the results, using R, of IDW interpolation to only the area containing the original set of data points? In the example below, 20 random points are used to ...
0
votes
2answers
54 views

finding the percentage > x with r

Trying to locate the names of countries in my data.frame where the most spoken language is not an official language. My columns data.frame is World. The column <...
0
votes
0answers
26 views

Including spatial spillover for categorical data in R

I did a regression analysis with categorical data with a glm model approach, which worked fine. I have longitude and latitude coordinates for each observation and I ...
0
votes
1answer
138 views

Reverse of Yeo Johnson variable transformation done by preprocess function in caret package to get original Target and predicted values

I have done a Yeo Johnson transformation by using preprocess from caret package. I have predicted the Target Variable using linear regression. Now I want to reverse the transformation for both the ...
1
vote
1answer
73 views

Finding the equation for a multiple and nonlinear regression model?

Regarding nonlinear and multivariable regression, I am using R or Matlab. In the case where I have a regression with just two variables, I simply draw the graph Y with respect to X and look for the ...
0
votes
1answer
21 views

Calculate mean by decile in Svydesign object

So, I´m working with ENIGH - Database, which stands for ¨National Survey of Household Income and Expenses¨ in Spanish, this is an exercise conducted by the Mexican government and like most surveys of ...
0
votes
1answer
14 views

What does mtry < 1 in TuneRF mean?

I'm running a random forest model using the randomForest package in R, using the TuneRF function. I have the option to set the 'step factor', which is how much the mtry parameter is changed at each ...
1
vote
1answer
9 views

How much data should I allocate for my training and and test sets? (in R)

I have a matrix of 358.367 data. Each row is a DNA sequence from the human genome. I want to build a classification model in R, using XGBoost algorithm and 83 features (dinucleotides, trinucleotides, ...
0
votes
1answer
26 views

Remove all characters following a certain character in a column of a dataset

I have a data set like the following, and the first column contains the groupings. However, some are labelled slightly differently. I need to remove all characters following the punctuation used (...
6
votes
1answer
403 views

A clear visualization of a two-way ANOVA

To provide a full yet simple picture of a 3-level, one-way ANOVA, I use the following visualization where variation within each group (the filled circles) and variation between the groups (black ...
0
votes
1answer
18 views

droplevels not dropping anything

I am trying to use droplevels. First I create a subsect of my dataset where the value of attribute Rat must be different from 1 or 5. That value must be a factor. Then, I can see levels are "1", "2", "...
0
votes
1answer
341 views

Importing C4.5 file to R dataframe

I want to convert the input data available as C4.5 file format into a R data frame. The data set can be downloaded from the following link https://archive.ics.uci.edu/ml/machine-learning-databases/...
2
votes
1answer
560 views

Calculate weighted mean for two columns and hundreds of rows?

I'm trying to teach myself basics of R and I couldn't find the answer: Say, I have a csv file and I want to calculate weighted mean for each subject such that I have a mean mu = 0.015*1030+0.16*26930+...
3
votes
1answer
603 views

Why does Caret featurePlot returns returns NULL?

I am trying to use featurePlot of caret in R. This is the code I am using: ...
0
votes
1answer
15 views

Perform bootstrapping of an ordinary linear regression model, using B=100 bootstrap resamples of my dataset, and getting RMSE

So Im studying machine learning through R, and Im working with the boston data set from the library MASS. I am practicing bootsrapping. I already carried out analysis to determine how ,many distinct ...
0
votes
1answer
18 views

Is my bayes classification right or meaningful?

I have this dataset and I am learning about Bayes Classifier. After data cleaning, I have tried to use bayes classifier on it. I used R with this code: ...
0
votes
1answer
69 views

Extract or subset hundreds of columns from a data frame

I need to extract many columns from a dataset. I have a very large csv file with thousands of columns and rows, and I read it into R using: ...
1
vote
1answer
21 views

should we include or exclude a variable in a logistic regression based on the description below?

should we include or exclude a variable in a logit regr. model which will only obtain values if a certain event takes place otherwise will show N/A? this variable tells whether or not a product will ...
1
vote
0answers
24 views

What is considered best practice when importing data in a 'pipeline'?

Let's say I have some sort of process that takes data from a CSV that is located on my local machine. This process will eventually need to be scheduled via some cron job. I need to import that data ...
1
vote
1answer
50 views

Randomizing selection in R

I am trying to create a comparison group. So far this group contains 45 data points and I need to populate the remaining 55 (for a total of 100 data points). These remaining 55 need to be a ...
1
vote
0answers
41 views

Problem in performing LOOCV

I am trying to run LOOCV on my regression model. I tried to run it in r and encountered the following warning message: ...
1
vote
1answer
75 views

Mirror column plot with different y-axis in ggplot

I am trying to convert this plot Into a mirror column plot I have two datasets: school_purchases recent_school_shootings I am not very experienced with visualisation but this is my approach ...
4
votes
6answers
59k views

How to count observations per ID in R?

I have a large amount of Data where I have to count meassurments per one ID. What I already did was creating a Data Frame over all Files and I omited the NAs. This part works properly. I was wondering ...
0
votes
0answers
26 views

Getting an error when reading a graph into R

I am trying to read network data in R using the following code: g = read_graph('dolphins.gml', format = 'gml') This brings up the following error message: ...
1
vote
2answers
39 views

What's my target variable?

I am beginner in data science. I have this "aids" dataset from "mdhglm" package in R. dataset = aids, info = Repatead Measures on AIDS Data ...
2
votes
1answer
1k views

SMOTE for regression

I am looking into upsampling an imbalanced dataset for a regression problem (Numerical target variables) in python. I attached paper and R package that implement SMOTE for regression, can anyone ...
0
votes
1answer
27 views

Is it appropriate to run correlation on continuous y value with discrete x value?

I am dealing with temperature data that are measured in different distances away from the forest edge (0m, 10m,30m,50m,80m) and I would like to find out whether the temperature will drop as the ...
1
vote
1answer
27 views

Regime detection to identify transitions between habitats

The following figure represents the concentration of a substance (referred to as Element in the code) measured in an organism throughout its life. There are ...
0
votes
1answer
19 views

How to run a model stored as a .Rda file?

I am using an already written R code which has a line of code as shown below ...

1 2 3
4
5
25