Skip to main content

Questions tagged [r]

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

0 votes
0 answers
49 views

I have this R code for mediation analysis based on AFT. Can someone take a look? https://github.com/cristianricciwork-commits/aft-mediation..git I suggest to take a look at the .pptx (there are ...
Cristian ricci's user avatar
1 vote
0 answers
74 views

Background In an earlier post, I prototyped an M equivalent of tidyselect in R: in particular, its general syntax and selection helpers. In this post, I prototype ...
Greg's user avatar
  • 569
1 vote
0 answers
119 views

I'm looking to optimize my code by avoiding the use of a for loop, in order to improve performance when working with large data frames controlled by ...
Sophie Père's user avatar
5 votes
1 answer
243 views

I am computing the rolling Median Absolute Deviation (MAD) in R for outlier detection in a time series dataset. The goal is to: Detect outliers based on a rolling MAD. Exclude previously detected ...
user2845095's user avatar
0 votes
0 answers
69 views

I am trying to write R code to see how much money someone could have made in the stock market had they invested in a certain amount of money in a certain stock between two dates (while taking into ...
antonoyaro8's user avatar
7 votes
2 answers
391 views

I came up with these lines to test if an R list contains a certain element at a given index (supplied by purrr::pluck syntax): <...
thothal's user avatar
  • 171
3 votes
1 answer
108 views

I recently wrote some R code, which I would normally not do, to find repeats in DNA fasta files. Here is an example fasta file: ...
con's user avatar
  • 361
2 votes
1 answer
250 views

Let X = "1234567891011..." the infinite string contains all positive integers. str is a sequence of digits. We are asked to find the first location in X that str appears. I have tried the ...
PUBSGUSO's user avatar
4 votes
1 answer
242 views

I have this network graph in R: ...
farrow90's user avatar
2 votes
0 answers
111 views

I tried writing a short function that expands brackets [] within a regular expression. Given a regular expression, the function will expand the brackets and return ...
nightstand's user avatar
1 vote
0 answers
48 views

I am working with the R programming language. I have data on crop yield and fertilizer costs. I want to make a time series model (ARIMAX) that predicts crop yield based on (crop yield -1, crop yield -...
antonoyaro8's user avatar
4 votes
1 answer
109 views

Consider a generic (univariate) time series model: $$ \hat{y}(x_n, \ldots, x_{n+h-1} \mid x_0, \ldots, x_{n-1}; \boldsymbol{\theta}) $$ Where: $$ \hat{y}_{t+h} \text{ is the forecast for the next } h \...
antonoyaro8's user avatar
6 votes
2 answers
126 views

Here is an attempt to translate a R function to Rcpp. The goal is to group every n observations together (of a numeric vector) and calculate the mean. On big'ish vectors the R function is almost two ...
snoram's user avatar
  • 465
2 votes
1 answer
167 views

This is my first time writing a script for volatility forecasting and I am fairly new to econometrics. I chose to analyze monthly WTI crude oil prices of past 20 years and determine volatility as well ...
dovexz12323's user avatar
4 votes
2 answers
96 views

Just wanted some code review for correctness here. This is a little app for plotting newborn feeding data (important to keep track of in the first 48 hours of so) that I hope to provide to a clinic, ...
Samuel Weisenthal's user avatar

15 30 50 per page
1
2 3 4 5
26