888 questions
0
votes
0
answers
79
views
How can I recreate ewm(adjust=False).std() in Pandas?
This recreates ewm(adjust=True).std(): pandas ewm var and std, but I have no luck replicating the calculations in ewm(adjust=False).std(). Replicating ewm(False).mean() is easy but how is the bias ...
6
votes
1
answer
158
views
Why does Pandas rolling std output different results for different tail sizes?
Output of pandas rolling std is not consistent when data size changes. I tried to apply rolling std for different slices of the data, while all of them are at the tail of the series. I observed that ...
1
vote
0
answers
62
views
Pine script: how can I add a "Standard deviation channel" to a polynomial regression?
I have found a script for generating a polynomial regression, which I have adapted to my needs and which basically works.
However, in order to be able to use the script the way I want to, I need a ...
2
votes
1
answer
47
views
What is the Indie's equivalent to Pinescript's StDev algorithm?
I'm trying to create a simple volatility indicator in Indie but keep getting an error when trying to import the standard deviation algorithm.
I'm getting this error:
Error: 3:39 package indie....
0
votes
0
answers
26
views
What is happening when I model the sigma term in a glmm with a Gaussian distribution in brms
If I am interested in understanding the effect of an interaction between treatment and covariates on the variance of my response, as well as how they may affect the mean of my response, can I write a ...
0
votes
1
answer
194
views
Calculate standard deviation of average duration of last 1 day to last 30 days
I'm trying to find the standard deviation of average duration in a table for the last 1 day as compared to the last 30 days average duration.
let table1 = view() {
requests | where TimeGenerated > ...
0
votes
0
answers
87
views
Backtransforming standard errors from scaled variables
I use data with scaled values based on this dataset I made a model such as :
data <- data.frame(
X1 = c(1.2, 2.3, 3.1, 4.8, 5.5, 4.6),
X2 = c(10.4, 9.3, 8.2, 7.1, 6.0, 5.2),
X3 = ...
0
votes
2
answers
206
views
Calculate Means and SDs for each column using dplyr´s "summarise_all"
I have a large dataset, containing a categorical (Size) and a numeric variable(Fraktion) to group the data. The rest are analytical resultd like numeric values. Every value got sampled 3 times, and I ...
0
votes
1
answer
129
views
How to get error bars in ggplot2 when the SD is greater than the mean?
I have salinity data where for one month, the standard deviation is greater than the mean. The system is an estuary, and there was a lot of freshwater input that month, so the salinity values in the ...
1
vote
1
answer
85
views
Troubleshooting code: Calculate the differences between mean-max and mean-median per peak in the same dataset, and print as standard deviation
I've spent 2 weeks writing code from scratch and improving it in various ways until this final problem.
My code is intended to calculate the two differences per peak (there are 2 peaks per dataset, ...
2
votes
1
answer
578
views
Plotting Confidence Intervals on a ggplot
I am quite new with r so bear with me please. I am plotting a daily avg temperature across a four month period. I want to be able to visualize the confidence I have across the data. I believe the best ...
2
votes
0
answers
67
views
Calculating the locations of the maximum and mean, and the standard deviation between them, with respect to local and absolute maxima, within dataset
I have multiple datasets of data, for which a compound sigmoid fitting curve is plotted to each. The derivatives of each fit curve are taken, resulting in 6 different theoretical derivative curves. ...
1
vote
0
answers
93
views
Numpy std giving completely wrong result
I have the following script that generate 3 blobs, and plots the radius an standard deviation of all.
for the third blob (centered in (20,1)) i get a std that is bigger than the radius (that is ...
0
votes
0
answers
31
views
What is the standard deviation/uncertainty of a single observation in a meta-analysis?
I am running a simulation with parameters based on an existing random-effects meta-analysis. I would like to draw individual patients in the treatment group from a normal distribution with µ=the ...
0
votes
1
answer
79
views
How to solve an inequality that contains standard deviation in python?
I have the past 19 days of stock price stored in the pd.dataframe and I am trying to find out the price P that is smaller than (mean - 2.5*standard deviation), where mean and standard deviation are ...
0
votes
1
answer
111
views
Advanced peak "blocks" analysis
I have very basic knowledge in programming and I have been using some tips I found here, and for that thank you in advance.
Moving on to the problem, I am analyzing data from optical sensors that are ...
1
vote
0
answers
65
views
Tableau window calculations will only accept aggregated values
I have a dataset where every row has a datetime and a value. What I am trying to do with Tableau is to calculate the rolling average and rolling stdev of said value for the past 7 days. I am not able ...
0
votes
0
answers
87
views
Weighted Standard Deviation on Excel Pivot Table
I have a dataset of investments with the following columns
Investment
Investment Rating
Commitment
Region
Portfolio
Helper
A
10
100
Asia
P1
1000
B
9
250
Africa
P2
2250
C
8
300
S. America
P1
2400
D
11
...
0
votes
0
answers
18
views
How to calculate the heterogeneity of a variable which is divided into three separate columns in R
I have the variable proportion of vegetation height for each transect in a field study, which is categorized into vegetation below 5cm, between 5 and 15cm, and over 15cm. Since each measure is a ...
1
vote
1
answer
89
views
Need to calculate the SD of sleep bedtime using 24 hour time with some observations after midnight
I am getting sleep times and converting them to minutes to then calculate the standard deviation between bedtimes on different days. The issue is that some days the bedtime is after midnight. I got it ...
1
vote
0
answers
209
views
How to do [(mean) +- (2*standard deviation)]
I'm new to R and I'm trying to understand how to do the mean +- 2 times standard deviation. I've tried calculating the mean and the standard deviation singularly and then do the aritmetic calculation ...
0
votes
1
answer
97
views
Adjust max distance for stumpy match function
I use python stumpy to extract subsequences from a timeseries. For a pattern Q and a timeseries T, I use the function stumpy.match https://stumpy.readthedocs.io/en/latest/api.html#stumpy.match
Now ...
0
votes
2
answers
2k
views
R: Plot of mean values with error bars for grouped data
I have the following problem. The data-set was collected in a within-subject design with repeated measures. My data-set contains 4 variables. The participant ID, the participant's sex, condition and ...
0
votes
1
answer
91
views
Computing standard deviation by groups by year and conference [duplicate]
First, I am new to R programming, so much of my problem may be a misunderstanding of the basics.
I am working on research in college football and am trying to automate the calculation of the standard ...
0
votes
1
answer
214
views
Generate Array of Random Numbers with Specified Standard Deviation and Mean
I would like to create an N by 1 array of doubles where N is any integer value. Each value in the array should deviate from a nominal value n using a standard deviation of n/10 and mean of 0. n can be ...
0
votes
2
answers
964
views
Pandas - calculate rolling standard deviation over all columns
Say I have a pd.DataFrame and want to calculate the rolling Standard deviation. In pandas I can use rolling(window=x).std(), but it gives me the SD by column. I however want the standard deviation ...
0
votes
1
answer
235
views
Exponential moving standard deviation calculation in R
When looking at the picture Difference_EMA_SMA_Standard_Deviation we observe that sometimes exponentially weighted moving standard deviation (EMA_SD) is significantly different from standard moving ...
0
votes
1
answer
99
views
SAS Proc Standard and the equivalent in Python
In SAS, Proc Standard allow users to standardise data into a certain mean and standard deviation by a certain group.
Here, I want to standarize age to a of mean = 0 and deviation =5 for each surname. ...
2
votes
2
answers
3k
views
Line plot with standard deviation bar [duplicate]
I am trying to create a plot that should also show the standard deviation. Here is my data
y20_6 = np.array([18351.6,17976.6,16101.6])
y20_12 = np.array([15664.1,16984.4,18304.7])
y20_18 = np.array([...
1
vote
0
answers
99
views
Calculate SE and SD in mixed ANOVA
I have conducted a mixed-design ANOVA with a between-subjects factor (Group: Control Group [0] vs. Intervention Group [1]) and a within-subjects factor (Time: Baseline [0], Follow-up 1 [1], and Follow-...
0
votes
1
answer
23
views
Converting Dataframe with Group Means and Standard Deviations in R
I have a large dataset with four variables, like this:
Public_Issue
Voter_Partisanship
Population
value
2
non-partisan
Politicians
40
2
moderately-partisan
Voters
42
2
moderately-partisan
Politicians
...
0
votes
0
answers
40
views
Is there a way to identify the number of decimal places in a floating point number from an array of data?
I am writing a simple script that takes multiple inputs as a set of data. The output should be rounded to one more decimal place than the largest one inputted. For example, if my input data is [3, 6.2,...
0
votes
2
answers
314
views
Calculate average between mean and 1st standard deviation
I have an array:
import numpy as np
# Create an array of values
values = np.array([41,17,44,36,14,29,33,38,49,39,22,15,46])
# Calculate the mean
mean = np.mean(values)
# Calculate the standard ...
0
votes
0
answers
22
views
Restrain stat_summary errorbars within specified y-axis range in violin plot (ggplot2) [duplicate]
I'm creating a violin plot and am wanting to add a
stat_summary
argument to show the mean and standard deviation/errorbars for each group. However, when I do this, the y-axis is reorientated so that ...
0
votes
1
answer
102
views
Is there a function to get the standard deviation of a dataset after interpolation?
I interpolated a dataset as follow:
y = [-2.35771490e-04, -2.04672372e-04, 5.40550849e-06, -3.26933980e-04,
-4.31306957e-04, -4.06928662e-04, -7.50889655e-04, -1.03669983e-03,
-5....
0
votes
1
answer
125
views
Finding standard deviation, standard error and summary of all columns of sheet and storing the info in new table in R-language
calculate_stats <- function(x) {
non_missing_values <- na.omit(x)
if (length(non_missing_values) >= 1) {
sd_val <- sd(non_missing_values, na.rm = TRUE)
se_val <- sd_val / sqrt(length(...
0
votes
2
answers
69
views
Standardizing each observation using the mean and standard deviation calculated using only prior observations
I am able to Standardizing each observation for the variable "len" using the mean and standard deviation calculated from only prior observations. However, I am uable to attach it as a column ...
1
vote
1
answer
69
views
Is there another way to represent the confidence interval as an error bar?
I am currently working on a code that involves representing the mean standard deviation of the total weight of species collected over forest stands containin shelterbelts (Yes, No) further I want the ...
0
votes
1
answer
4k
views
Using pandas, how do I summarize my dataframe to show daily average and standard deviation per category?
I have a dataframe that has a datetime Purchase Date column, a float64 Price column, and an object Location column. I have over 1000 locations, and almost all locations do not have daily data.
I need ...
2
votes
1
answer
93
views
How to decrease execution time of standard deviation calculated azimuthally
I am using the below code to calculate standard deviation azimuthally for 2D array converted from images. However, the code takes couple minutes to run. Can anyone suggest how this can be made faster?
...
0
votes
1
answer
855
views
Power BI - Averaging by group then removing outliers based on standard deviation
I have a dataset that includes the following columns
Unique ID, Activity, Activity Duration
I was able to create a matrix that looks like this (I am not including the activity types for anonymity but ...
0
votes
1
answer
118
views
Calculate standard deviation of a subgroup of data
I am trying to calculate the standard deviation for a subgroup of data within my data set.
For every year, the standard deviation shall be calculated for those values, that are above the mean value ...
0
votes
0
answers
93
views
One-sided T-test using np.var and np.sqrt (Python)
This is the exercise:
For both of these exercise, you get two lists of values that you want to compare. You will have
to calculate the variance and the means, then compare them according to the t-test....
1
vote
1
answer
52
views
I want to plot row means of multiple columns as geom_line and standard deviation with geom_smooth
I managed to plot the means as a line, however, I do not know how to plot their respective standard deviation as geom_smooth.
When I just use the geom_smooth function, it does not seem to plot the ...
-1
votes
2
answers
543
views
Outlier detection Stata with standard deviation in time series
I have a dataset of 10 participants. These participants conducted different walking tests and physiological responses (i.e., heart rate, breathing frequency) were collected.
I want to detect outliers ...
3
votes
2
answers
196
views
How to do operations to a document other than the current one in MongoDB's setWindowFields
I have a MongoDB collection like this:
[
{
"_id": 1,
"price": 1
},
{
"_id": 2,
"price": 2
},
{
"_id": 3,
"price&...
0
votes
0
answers
28
views
SD across multiple columns with NA data grouped by participant
I have 3 columns. The first column is the participant number. The other two are reaction time (RT) data with NAs in them. I want to get the standard deviation across the two columns to end up with one ...
0
votes
1
answer
45
views
Can't calculate the standard deviation
I am trying to calculate the standard deviation applied to all rows of my column called Months between with a format like this [5, 1, 3, 1, 2, 2, 1, 3, 3, 1]
I have tried simply with this:
merged_df[&...
0
votes
0
answers
640
views
creating a structure to store student information and grades, and calculate mean and grade of each student and the mean and standard deviation in C++
I'm working on answering the following question
Create a structure representing a student object with the following members
regno.
courseid
unitsRegistered: This should be an array of the course units ...
1
vote
1
answer
106
views
Summarising survey data with surveySE from the Rmisc package to produce errorbars in ggplot
I am trying to group the following data so that I can use summarySE from the Rmisc package to later plot errorbars for this data. I have tried grouping in various ways but neither of my tries does ...