id stringlengths 7 11 | source stringclasses 1
value | category stringclasses 11
values | title stringlengths 15 214 | text stringlengths 70 30.5k | url stringlengths 57 160 | tags stringlengths 3 113 | created_at int64 1.22B 1.79B |
|---|---|---|---|---|---|---|---|
se_40032739 | stackoverflow | DATA_SCIENCE | Which of the averaging of the AUC-ROC / AUC-PR on scikit-learn are usually used on papers when comparing classifiers | Which of the averaging of the AUC-ROC / AUC-PR on scikit-learn are usually used on papers when comparing classifiers
I've read lots of paper with classification focus and most of them said that using AUC-PR is better when working with an imbalanced problem .. such as this quotes from here:
A large number change in... | https://stackoverflow.com/questions/40032739/which-of-the-averaging-of-the-auc-roc-auc-pr-on-scikit-learn-are-usually-used | python, machine-learning, scikit-learn, statistics | 1,476,402,002 |
se_77269816 | stackoverflow | DATA_SCIENCE | Is there a way to identify the number of decimal places in a floating point number from an array of data? | 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, 7, 9, 5.47,... | https://stackoverflow.com/questions/77269816/is-there-a-way-to-identify-the-number-of-decimal-places-in-a-floating-point-numb | python, statistics, rounding, standard-deviation, stdev | 1,696,988,965 |
se_73102363 | stackoverflow | DATA_SCIENCE | Uniformity test on a large set using scipy.stats.kstest | Uniformity test on a large set using scipy.stats.kstest
I'm playing around with some hardware entropy creation. I'm using electronic sensors to sample the environment, using A2D with between 12-16 bits of resolution. I'm hypothesizing that the lower-order bits from these readings contain enough noise and real-world en... | https://stackoverflow.com/questions/73102363/uniformity-test-on-a-large-set-using-scipy-stats-kstest | python, random, statistics, cryptography, numpy-random | 1,658,699,985 |
se_77247521 | stackoverflow | DATA_SCIENCE | Appending values to a vector from replicate function in R | Appending values to a vector from replicate function in R
I'm trying to replicate a function some number of times, and at the end of each iteration append a value to a vector so that by the end of the replication I'll have a vector with entries that I can take the mean of.
This is my code
z <- vector()
n <- 1000
maxr... | https://stackoverflow.com/questions/77247521/appending-values-to-a-vector-from-replicate-function-in-r | r, statistics | 1,696,628,859 |
se_44105773 | stackoverflow | DATA_SCIENCE | How do I show a scatter plot in Python after doing PCA? | How do I show a scatter plot in Python after doing PCA?
I made a random data of my own, that comprises of a text file with 18 rows and 5 columns with all integer entries.
I successfully managed to do PCA but now stuck. I am unable to do a scatter plot. Here is my code:
f=open(r'<path>mydata.txt')
print(f.read()) #re... | https://stackoverflow.com/questions/44105773/how-do-i-show-a-scatter-plot-in-python-after-doing-pca | python, matplotlib, statistics, anaconda, data-science | 1,495,433,569 |
se_936748 | stackoverflow | DATA_SCIENCE | Declaring a Const Variable in R | Declaring a Const Variable in R
I'm working in R, and I'd like to define some variables that I (or one of my collaborators) cannot change. In C++ I'd do this:
const std::string path( "/projects/current" );
How do I do this in the R programming language?
Edit for clarity: I know that I can define strings like this ... | https://stackoverflow.com/questions/936748/declaring-a-const-variable-in-r | r, statistics, constants | 1,243,889,790 |
se_77247906 | stackoverflow | DATA_SCIENCE | Bimodal Distribution - how to find the 3 values of X that divide the distribution into 3 groups? | Bimodal Distribution - how to find the 3 values of X that divide the distribution into 3 groups?
I want to find those values of X which divides the bimodal distribution into 3 groups. For example, in my code below, based on the bimodal plot, an approximate values such values are x less than 5, (x greater than 5 and le... | https://stackoverflow.com/questions/77247906/bimodal-distribution-how-to-find-the-3-values-of-x-that-divide-the-distributio | python, numpy, scipy, statistics | 1,696,638,524 |
se_41974615 | stackoverflow | DATA_SCIENCE | How do I calculate PDF (probability density function) in Python? | How do I calculate PDF (probability density function) in Python?
I have the following code below that prints the PDF graph for a particular mean and standard deviation.
Now I need to find the actual probability, of a particular value. So for example if my mean is 0, and my value is 0, my probability is 1. This is usu... | https://stackoverflow.com/questions/41974615/how-do-i-calculate-pdf-probability-density-function-in-python | python, numpy, statistics, probability-density | 1,485,935,979 |
se_6629165 | stackoverflow | DATA_SCIENCE | k-fold Cross Validation for determining k in k-means? | k-fold Cross Validation for determining k in k-means?
In a document clustering process, as a data pre-processing step, I first applied singular vector decomposition to obtain U, S and Vt and then by choosing a suitable number of eigen values I truncated Vt, which now gives me a good document-document correlation from ... | https://stackoverflow.com/questions/6629165/k-fold-cross-validation-for-determining-k-in-k-means | python, statistics, numpy, nlp, machine-learning | 1,310,151,611 |
se_59308441 | stackoverflow | DATA_SCIENCE | Fitting For Discrete Data: Negative Binomial, Poisson, Geometric Distribution | Fitting For Discrete Data: Negative Binomial, Poisson, Geometric Distribution
In scipy there is no support for fitting discrete distributions using data. I know there are a lot of subject about this.
For example if i have an array like below:
x = [2,3,4,5,6,7,0,1,1,0,1,8,10,9,1,1,1,0,0]
I couldn't apply for this arr... | https://stackoverflow.com/questions/59308441/fitting-for-discrete-data-negative-binomial-poisson-geometric-distribution | python, scipy, statistics, distribution | 1,576,166,236 |
se_77236080 | stackoverflow | DATA_SCIENCE | A/B testing using t test | A/B testing using t test
I am running some simulations to test changes to the current model, Let's call the changes as new algorithm.
My model predicts the route for a particular transaction between two possible routes. The success rate is defined as total success/ total transactions.
The below dataframe has two colum... | https://stackoverflow.com/questions/77236080/a-b-testing-using-t-test | python, pandas, statistics, simulation, ab-testing | 1,696,499,908 |
se_77235772 | stackoverflow | DATA_SCIENCE | Effect size for Dunnett's test and Steels test | Effect size for Dunnett's test and Steels test
I did Dunnett's test and Steels test using R, but I cannot know how to calculate the effect size.
Could you show me how to calculate the effect sizes for Dunnett's test and Steels test.
## https://zenn.dev/masahiro_kondo/articles/7a0250c97e41f6
#data generation
set.se... | https://stackoverflow.com/questions/77235772/effect-size-for-dunnetts-test-and-steels-test | r, statistics, statistical-test | 1,696,497,506 |
se_15939495 | stackoverflow | DATA_SCIENCE | Is the bash function $RANDOM supposed to have an uniform distribution? | Is the bash function $RANDOM supposed to have an uniform distribution?
I understand that the bash function $RANDOM generates random integer number within a range, but, are these number supposed to follow (or approximate) an uniform discrete distribution? | https://stackoverflow.com/questions/15939495/is-the-bash-function-random-supposed-to-have-an-uniform-distribution | linux, bash, statistics | 1,365,645,476 |
se_77223307 | stackoverflow | DATA_SCIENCE | Ways to determine the statistical significance between two independent datasets | Ways to determine the statistical significance between two independent datasets
Suppose A and B are two datasets. The datasets might have 100 features each. How do I perform hypothesis testing on these independent datasets to compare statistical significance?
I tried to write a code in Python. I have preprocessed both... | https://stackoverflow.com/questions/77223307/ways-to-determine-the-statistical-significance-between-two-independent-datasets | python, statistics, analytics, hypothesis-test, kolmogorov-smirnov | 1,696,344,185 |
se_77230331 | stackoverflow | DATA_SCIENCE | Difference in python quantile (numpy, statistics) | Difference in python quantile (numpy, statistics)
today I made my own function to solve quantile/decile/percentile:
from math import floor, ceil
def mean(x: list)->float:
""""arithmetic mean (average) of list
adding all elements and divide by umber of elements"""
if len(x) < 1:
raise TypeError("mean need at least ... | https://stackoverflow.com/questions/77230331/difference-in-python-quantile-numpy-statistics | python, numpy, function, statistics, quantile | 1,696,428,545 |
se_77225147 | stackoverflow | DATA_SCIENCE | Improving model when Coefficient of Determination (R²)is inconsistent | Improving model when Coefficient of Determination (R²)is inconsistent
Many examples in the literature state that the value of the coefficient of determination (R²) is a value between 0 and 1, but some cases in my regression model yielded negative results. While researching on the StackOverflow community and also ... | https://stackoverflow.com/questions/77225147/improving-model-when-coefficient-of-determination-r%c2%b2is-inconsistent | python, machine-learning, statistics | 1,696,362,756 |
se_77222795 | stackoverflow | DATA_SCIENCE | Oracle 19c Incremental Statistics Strange Behaviour | Oracle 19c Incremental Statistics Strange Behaviour
I have a large table with 2100 partitions. Data is loaded into this table every day, but I don't know exactly which partitions the data will go into. However, on average, about 6-7 partitions receive data each day.
I'm attempting to obtain incremental statistics on t... | https://stackoverflow.com/questions/77222795/oracle-19c-incremental-statistics-strange-behaviour | database, oracle-database, statistics, partition, oracle19c | 1,696,340,324 |
se_14952123 | stackoverflow | DATA_SCIENCE | Stop alexa to gain the visitor stats | Stop alexa to gain the visitor stats
Is there a way I stop alexa to gain the visitors stats, I don't want that every one search my domain in alexa and get information about the overal users stats or get the information that on which country are users viewing my site the most or other stats about them.
For example when... | https://stackoverflow.com/questions/14952123/stop-alexa-to-gain-the-visitor-stats | statistics, limit, nofollow, alexa-internet | 1,361,259,282 |
se_77216949 | stackoverflow | DATA_SCIENCE | Mediation analysis with mma() package in R error: Error in Anova.III.LR.glm(mod, singular.ok = singular.ok) | Mediation analysis with mma() package in R error: Error in Anova.III.LR.glm(mod, singular.ok = singular.ok)
I am trying to run a mediation analysis with multiple parallel mediators using the mma() package in R. However, every time I try to run my code below, I am getting an error:
library(mma)
vcsqi <- as.data.frame(... | https://stackoverflow.com/questions/77216949/mediation-analysis-with-mma-package-in-r-error-error-in-anova-iii-lr-glmmod | r, statistics | 1,696,262,534 |
se_77183979 | stackoverflow | DATA_SCIENCE | Recommenderlab: Predict by UBCF binary rating matrix | Recommenderlab: Predict by UBCF binary rating matrix
In recommenderlab R package, on predicting UBCF based on binary rating matrix, why does the script do crossprod between knn (k nearest neighbors) similarities and new input binary ratings for the items? I'm writing a study and I wondering why is it a good way.
The r... | https://stackoverflow.com/questions/77183979/recommenderlab-predict-by-ubcf-binary-rating-matrix | r, statistics, collaborative-filtering, cross-product, recommenderlab | 1,695,772,205 |
se_77211745 | stackoverflow | DATA_SCIENCE | cannot allocate memory in static R regression | cannot allocate memory in static R regression
I'm trying to run a regression in R and I want to control the fipsmerg variable by factors but R gives me a memory error.
input:
myprobit <- glm(a_imt~a_imt_1+totpop+reltrad_1+reltrad_2+reltrad_3+reltrad_4+as.factor(fipsmerg),data = data, family=binomial(link="probit"))
l... | https://stackoverflow.com/questions/77211745/cannot-allocate-memory-in-static-r-regression | r, statistics, linear-regression, stata, panel-data | 1,696,184,306 |
se_77100440 | stackoverflow | DATA_SCIENCE | Method to find the quantile of a sample value given value vector in julia | Method to find the quantile of a sample value given value vector in julia
How do I calculate the quantile of a sample value given an array of samples in julia?
The Statistics.jl package kind of goes the other way here.
samples = collect(1:50)
sample = 27
quantile(samples, sample) | https://stackoverflow.com/questions/77100440/method-to-find-the-quantile-of-a-sample-value-given-value-vector-in-julia | statistics, julia | 1,694,638,539 |
se_77205079 | stackoverflow | DATA_SCIENCE | How to draw a normal distribution with only integer values within a set range | How to draw a normal distribution with only integer values within a set range
I am trying to draw a normal distribution with only integers within a range. I tried reading other posts here in stackoverflow, although some are somewhat related, I still can't find the answer. I would like to draw a normal distribution, li... | https://stackoverflow.com/questions/77205079/how-to-draw-a-normal-distribution-with-only-integer-values-within-a-set-range | r, statistics, distribution | 1,696,027,168 |
se_77203251 | stackoverflow | DATA_SCIENCE | Rstatix: pairwise_chisq_test_against_p must sum to 1 | Rstatix: pairwise_chisq_test_against_p must sum to 1
I am trying to use the pairwise_chisq_test_against_p() function from the Rstatix package. I am doing this for a large dataset, where it mostly works fine, but I get the following error:
Error in pairwise_chisq_test_against_p(posClinSig, probVec) :
Make sure that th... | https://stackoverflow.com/questions/77203251/rstatix-pairwise-chisq-test-against-p-must-sum-to-1 | r, statistics, rstatix | 1,696,002,425 |
se_9789806 | stackoverflow | DATA_SCIENCE | command line utility to print statistics of numbers in linux | command line utility to print statistics of numbers in linux
I often find myself with a file that has one number per line. I end up importing it in excel to view things like median, standard deviation and so forth.
Is there a command line utility in linux to do the same? I usually need to find the average, median, mi... | https://stackoverflow.com/questions/9789806/command-line-utility-to-print-statistics-of-numbers-in-linux | linux, command-line, statistics | 1,332,257,508 |
se_77200277 | stackoverflow | DATA_SCIENCE | KL divergence corrected for limited sample size bias | KL divergence corrected for limited sample size bias
I have a reference distribution R from which I am sampling to create distributions of different sample sizes. These new distributions are of same dimensions but with different numbers of data points. When i'm calculating KL divergence of these sample distributions, ... | https://stackoverflow.com/questions/77200277/kl-divergence-corrected-for-limited-sample-size-bias | python, statistics, entropy, cross-entropy, thread-divergence | 1,695,974,307 |
se_76910744 | stackoverflow | DATA_SCIENCE | How to get predicted and observed risk estimates from riskRegression::FGR() subdistribution competing risk model object? | How to get predicted and observed risk estimates from riskRegression::FGR() subdistribution competing risk model object?
I want to extract observed and predicted estimates from time to event riskRegression::FGR() competing risk model object.
Below is some simulated data:
library(simstudy)
library(data.table)
library(s... | https://stackoverflow.com/questions/76910744/how-to-get-predicted-and-observed-risk-estimates-from-riskregressionfgr-subd | r, statistics, survival-analysis, cox-regression, survival | 1,692,163,945 |
se_77185292 | stackoverflow | DATA_SCIENCE | How to use !!sym when performing a shapiro_test on a dataframe undergoing a for loop? | How to use !!sym when performing a shapiro_test on a dataframe undergoing a for loop?
I am trying to loop through a dataframe and run both statistical summaries, tests and graph a plot by looping through certain columns within the dataframe. I am new to for loops in r, and sort of understand !!sym but still learning a... | https://stackoverflow.com/questions/77185292/how-to-use-sym-when-performing-a-shapiro-test-on-a-dataframe-undergoing-a-for | r, dataframe, statistics, tidyverse | 1,695,798,518 |
se_38256750 | stackoverflow | DATA_SCIENCE | Make a Scatter Plot in matplotlib with dates on x axis and values on y | Make a Scatter Plot in matplotlib with dates on x axis and values on y
I am having trouble making a scatter plot that has from a date array and a bunch of PM 2.5 values. My lists would look like the following:
dates = ['2015-12-20','2015-09-12']
PM_25 = [80, 55] | https://stackoverflow.com/questions/38256750/make-a-scatter-plot-in-matplotlib-with-dates-on-x-axis-and-values-on-y | python, list, matplotlib, statistics, scatter | 1,467,933,674 |
se_77175968 | stackoverflow | DATA_SCIENCE | Can Kernel Density Estimation be used to smooth 3D data? | Can Kernel Density Estimation be used to smooth 3D data?
I'm aware that KDE can be used to estimate the density of points in any number of dimensions. For example, if I use the sklearn implementation in python, I can simply feed in 3D data, fit the KDE model to that data, and then provide a number of 3d samples to det... | https://stackoverflow.com/questions/77175968/can-kernel-density-estimation-be-used-to-smooth-3d-data | python, machine-learning, scikit-learn, statistics, kernel-density | 1,695,679,935 |
se_77150254 | stackoverflow | DATA_SCIENCE | Simulating correlated reaction times and accuracies in R | Simulating correlated reaction times and accuracies in R
I would like to simulate reaction times and accuracies with a certain correlation among them.
This is my first guess:
n <- 2000
RTs <- brms::rshifted_lnorm(n, meanlog = log(1.3), sdlog = 0.1, shift = 0.5)
acc <- sapply(RTs,
FUN = function(x){
... | https://stackoverflow.com/questions/77150254/simulating-correlated-reaction-times-and-accuracies-in-r | r, statistics, simulation, correlation | 1,695,299,433 |
se_77177032 | stackoverflow | DATA_SCIENCE | Dropping perfect prediction cases (groups based on a categorical variable) before running probit | Dropping perfect prediction cases (groups based on a categorical variable) before running probit
I have a bunch of categorical variables as predictors for which I use the factor notation i.year for example. There are a few years (with a bunch of observations) that predict the outcome exactly. Stata very slowly goes th... | https://stackoverflow.com/questions/77177032/dropping-perfect-prediction-cases-groups-based-on-a-categorical-variable-befor | statistics, stata, estimation | 1,695,702,647 |
se_77133149 | stackoverflow | DATA_SCIENCE | How to perform Dickey Fuller with adf.test() with .txt data? | How to perform Dickey Fuller with adf.test() with .txt data?
How can I perform a Dickey Fuller in R with adf.test() with this PS1.txt data?
I got this error:
adf.test(data2)
Fehler in adf.test(data2) : x is not a vector or univariate time series
Please help with coding.
install.packages("tseries", dependencies = TRU... | https://stackoverflow.com/questions/77133149/how-to-perform-dickey-fuller-with-adf-test-with-txt-data | r, statistics | 1,695,114,323 |
se_77175013 | stackoverflow | DATA_SCIENCE | ETS models with standard deviation and confidence interval in fitted values | ETS models with standard deviation and confidence interval in fitted values
I applied a ETS model to this time series. I need to have the standard deviation and confidence interval in the fitted values.
import os
import numpy as np
import pandas as pd
import datetime as dt
import matplotlib.pyplot as plt
from statsmod... | https://stackoverflow.com/questions/77175013/ets-models-with-standard-deviation-and-confidence-interval-in-fitted-values | python, statistics, forecasting, smoothing, confidence-interval | 1,695,666,836 |
se_77174627 | stackoverflow | DATA_SCIENCE | How to calculate t-test for the difference of means to assess which algorithm achieves higher F1 score? | How to calculate t-test for the difference of means to assess which algorithm achieves higher F1 score?
I am working on a project in which my expected outcome is which classifier has performed very well on the basis of F1 Score. I am conducting a t-test for the difference of means to assess which algorithm achieves hi... | https://stackoverflow.com/questions/77174627/how-to-calculate-t-test-for-the-difference-of-means-to-assess-which-algorithm-ac | python, machine-learning, scipy, statistics, hypothesis-test | 1,695,662,508 |
se_1411199 | stackoverflow | DATA_SCIENCE | What is a better way to sort by a 5 star rating? | What is a better way to sort by a 5 star rating?
I'm trying to sort a bunch of products by customer ratings using a 5 star system. The site I'm setting this up for does not have a lot of ratings and continue to add new products so it will usually have a few products with a low number of ratings.
I tried using average... | https://stackoverflow.com/questions/1411199/what-is-a-better-way-to-sort-by-a-5-star-rating | sorting, statistics, user-experience, rating, bayesian | 1,252,679,041 |
se_77164801 | stackoverflow | DATA_SCIENCE | How to evaluate the performance of Machine Learning classifiers using Python by using Paired t-test? | How to evaluate the performance of Machine Learning classifiers using Python by using Paired t-test?
I am quite beginner in machine learning. I am trying to conduct a t-test for the difference of means to assess which algorithm achieves higher F1 score. I have results of both algorithms Such as F1_score for algorithm ... | https://stackoverflow.com/questions/77164801/how-to-evaluate-the-performance-of-machine-learning-classifiers-using-python-by | python, machine-learning, statistics, hypothesis-test, statistical-test | 1,695,501,120 |
se_77168697 | stackoverflow | DATA_SCIENCE | Handling Level Changes for Prophet Predictions | Handling Level Changes for Prophet Predictions
I have a dataset like so:
It is seasonal data, but there is a level shift after some point
I want Prophet to adapt to the data after the level shift faster. How can I do this?
I've read through the docs, there are some options:
delete older data
But is there any way to... | https://stackoverflow.com/questions/77168697/handling-level-changes-for-prophet-predictions | python, machine-learning, statistics, forecasting, prophet | 1,695,585,051 |
se_77128528 | stackoverflow | DATA_SCIENCE | Does it possible to make histogram in R but the x axis value is in decimal. and pre-determined manually | Does it possible to make histogram in R but the x axis value is in decimal. and pre-determined manually
I want to make a histogram where there are range with decimal on the x axis, does it possible?
data=c(321.68 , 329.51 , 327.89 , 291.97 , 303.26 , 297.18 , 466.74,
251.75 , 327.12 , 283.10 , 282.87 , 24... | https://stackoverflow.com/questions/77128528/does-it-possible-to-make-histogram-in-r-but-the-x-axis-value-is-in-decimal-and | r, statistics | 1,695,051,148 |
se_77159300 | stackoverflow | DATA_SCIENCE | Correlation R between categoric and binary variables | Correlation R between categoric and binary variables
I want to use the data attached to see i there is correlation between a bootcamp that students attended and the job they end up getting. For example, does someone who attended a software engineering bootcamp end up with a software job, or does attending a data scien... | https://stackoverflow.com/questions/77159300/correlation-r-between-categoric-and-binary-variables | r, variables, statistics, correlation | 1,695,399,735 |
se_76830122 | stackoverflow | DATA_SCIENCE | Scipy.stats Confidence Intervals for T-distribution are different than when calculated by hand | Scipy.stats Confidence Intervals for T-distribution are different than when calculated by hand
I’m trying to find the 95 percent confidence interval of the mean using the given array. The problem is whenever I try using the interval method from stats.t, it gives me a different result than my hand calculated confidence... | https://stackoverflow.com/questions/76830122/scipy-stats-confidence-intervals-for-t-distribution-are-different-than-when-calc | python, scipy, statistics, confidence-interval | 1,691,081,428 |
se_76812387 | stackoverflow | DATA_SCIENCE | How does XGBoost use MAE as objective function? | How does XGBoost use MAE as objective function?
XGBoost did not allow to use absolute error as objective function in the past since it is a non-differentiable function and its Hessian is equal to 0. However, it does allow to use it now (https://xgboost.readthedocs.io/en/stable/parameter.html).
How does it do it and ho... | https://stackoverflow.com/questions/76812387/how-does-xgboost-use-mae-as-objective-function | python, machine-learning, statistics, xgboost, boosting | 1,690,898,138 |
se_77146471 | stackoverflow | DATA_SCIENCE | Finding quantile numerically in R | Finding quantile numerically in R
I'm looking for an R code that would help me find the quantile when the pdf is given numerically. That is, say my data is
x = c(0.00,0.05,0.10,0.15,0.20,0.25,0.30,0.35,0.40,0.45,0.50,0.55,0.60,0.65,0.70,0.75,0.80,0.85,0.90,0.95,1.00)
and the corresponding pdf values are
pdf = c(0.000... | https://stackoverflow.com/questions/77146471/finding-quantile-numerically-in-r | r, statistics, linear-regression, numerical-methods, quantile | 1,695,253,992 |
se_77143155 | stackoverflow | DATA_SCIENCE | Properly accounting for cluster effects in survey-weighted logistic regression? | Properly accounting for cluster effects in survey-weighted logistic regression?
I have a dataset with person-specific survey weights which I am using to predict the probability of cigarette smoking. The survey works in such a way that all participants of randomly sampled households are interviewed. How do i account fo... | https://stackoverflow.com/questions/77143155/properly-accounting-for-cluster-effects-in-survey-weighted-logistic-regression | r, statistics, regression, survey | 1,695,218,005 |
se_76949508 | stackoverflow | DATA_SCIENCE | Choosing a weighted task in O(1) space-time complexity | Choosing a weighted task in O(1) space-time complexity
Suppose I have a list L of tasks. Each task is represented by an integer weight, which states how important the task is.
The importance of a task doesn't affect its order, but affects its chance of being chosen. For example: if I have 2 tasks A and B of weights 3 ... | https://stackoverflow.com/questions/76949508/choosing-a-weighted-task-in-o1-space-time-complexity | algorithm, math, statistics, time-complexity | 1,692,666,116 |
se_77123348 | stackoverflow | DATA_SCIENCE | for loop and generating random panel data | for loop and generating random panel data
I want to generate a panel data sets with 5 units and 10 observations in r and get the test statistics. However, my problem here is to do this process 1000 times. For each id I need to restart the cumsum argument again for randomness. I want to create 1000 random data sets by ... | https://stackoverflow.com/questions/77123348/for-loop-and-generating-random-panel-data | r, for-loop, statistics, regression, nested-for-loop | 1,694,979,683 |
se_75914079 | stackoverflow | DATA_SCIENCE | gtsummary transpose levels to be displayed horizontally | gtsummary transpose levels to be displayed horizontally
#gtsummary #rstats
I was wondering if there is a way to transpose the levels to display the tables in a horizontal fashion. Meaning I want the levels displayed horizontally. I think I read all similar posts but none explained how to transpose the levels (such as ... | https://stackoverflow.com/questions/75914079/gtsummary-transpose-levels-to-be-displayed-horizontally | r, statistics, gtsummary | 1,680,462,331 |
se_37472228 | stackoverflow | DATA_SCIENCE | Implementing a 2-sample KS test with 3D data in Python | Implementing a 2-sample KS test with 3D data in Python
I have two 3D distributions and I want to run a Kolmogorov–Smirnov test on these two samples to measure their similarity. scipy.stats has an implementation of a 2-sample K-S tests implemented in 1 dimension and I found an implementation in 2 dimensions, but none i... | https://stackoverflow.com/questions/37472228/implementing-a-2-sample-ks-test-with-3d-data-in-python | python, scipy, statistics, similarity | 1,464,302,632 |
se_57972943 | stackoverflow | DATA_SCIENCE | Distance between Multivariate Distributions | Distance between Multivariate Distributions
I have a dataset containing three features: gender, height and weight. I would like to find the distance between bivariate distribution of height and weight for males and bivariate distribution of height and weight for females. For calculating the distance between univariate... | https://stackoverflow.com/questions/57972943/distance-between-multivariate-distributions | python, statistics | 1,568,718,344 |
se_75650623 | stackoverflow | DATA_SCIENCE | R: how to use the Hodges-Lehman estimator? | R: how to use the Hodges-Lehman estimator?
"The Hodges-Lehmann estimator is the median of the combined data points and Walsh averages". In my data I have the data points before and after. I understand that the Hodges-Lehman estimator gives me a median of these data points combined. Am I correct? And how should this be... | https://stackoverflow.com/questions/75650623/r-how-to-use-the-hodges-lehman-estimator | r, statistics, statistical-test | 1,678,104,155 |
se_77101112 | stackoverflow | DATA_SCIENCE | Issue related to Chi-Square Goodness of Fit Test Calculation | Issue related to Chi-Square Goodness of Fit Test Calculation
I am trying to solve the question mentioned below. Based on my calculation, I am getting 2,239,444.68 as Chi-Square value and Degree of Freedom as 5. Based on the Chi-Square Calculator, I am getting P-value of 0.0000 but the correct P-value of the below quiz... | https://stackoverflow.com/questions/77101112/issue-related-to-chi-square-goodness-of-fit-test-calculation | r, statistics, probability, chi-squared, goodness-of-fit | 1,694,650,499 |
se_76654329 | stackoverflow | DATA_SCIENCE | Changing pvalue_thresholds, so that a new alpha (0.1 for eg instead of 0.5) can be set in Statannotations | Changing pvalue_thresholds, so that a new alpha (0.1 for eg instead of 0.5) can be set in Statannotations
I am a biochemist and my results are too fine for my economist friends they would prefer p-value significance to be set at 10% or alpha= 0.1 instead of the standard 5% (0.05). I used Statannotations the latest v0.... | https://stackoverflow.com/questions/76654329/changing-pvalue-thresholds-so-that-a-new-alpha-0-1-for-eg-instead-of-0-5-can | python, statistics, seaborn, p-value | 1,688,996,384 |
se_74584728 | stackoverflow | DATA_SCIENCE | QR Factorization for Linear Regression Line in R (using qr.solve) | QR Factorization for Linear Regression Line in R (using qr.solve)
So I'm trying to figure out how to use the command qr.solve in R to solve for the components of a best fit line (slope and intercept) in accordance to a particular data set. Although I already know how to do this using the lm function, to my understandi... | https://stackoverflow.com/questions/74584728/qr-factorization-for-linear-regression-line-in-r-using-qr-solve | r, statistics, linear-regression, linear-algebra, matrix-factorization | 1,669,487,996 |
se_77131759 | stackoverflow | DATA_SCIENCE | what is hypothesis testing? | what is hypothesis testing?
p-value? parameter tests?
I tried to solve it but I couldn’t.
An online retail company performed an A/B test to check whether changing the size of the cart icon increases the expected number of items added to the cart before either placing an order or leaving the website. Here are the numbe... | https://stackoverflow.com/questions/77131759/what-is-hypothesis-testing | statistics, ab-testing, abtest | 1,695,098,534 |
se_77095811 | stackoverflow | DATA_SCIENCE | What's the meaning of field bitVectors in column statistics(Hive)? | What's the meaning of field bitVectors in column statistics(Hive)?
column statistics test
I got information from the doc about Hive column statistics. For most of columns have filed bitVectors, what's the mean of it, and the rule to calculate it?
I create some tables and use analyze statement to calculate statisti... | https://stackoverflow.com/questions/77095811/whats-the-meaning-of-field-bitvectors-in-column-statisticshive | hadoop, hive, statistics, hive-metastore | 1,694,597,297 |
se_77134586 | stackoverflow | DATA_SCIENCE | Find four of a kind through simulation in r | Find four of a kind through simulation in r
There is something off about my function and I am not sure what it is.... any help would be greatly appreciated
#Create a deck of cards
suits <- c("Diamonds", "Clubs", "Hearts", "Spades")
numbers <- c("Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "... | https://stackoverflow.com/questions/77134586/find-four-of-a-kind-through-simulation-in-r | r, statistics, probability | 1,695,126,669 |
se_77113889 | stackoverflow | DATA_SCIENCE | AMOS The model is probably unidentified. In order to achieve identifiability, it will probably be necessary to impose 1 additional constraint | AMOS The model is probably unidentified. In order to achieve identifiability, it will probably be necessary to impose 1 additional constraint
enter image description hereI am trying to make a SEM for my dataset using AMOS and I do get below error . Does anyone know why do i get this error .I am very new to this softwa... | https://stackoverflow.com/questions/77113889/amos-the-model-is-probably-unidentified-in-order-to-achieve-identifiability-it | statistics, data-analysis, spss, amos | 1,694,794,258 |
se_77129613 | stackoverflow | DATA_SCIENCE | Function loop for creating and saving advanced statistical barplot (gglot) with dependence of response variable | Function loop for creating and saving advanced statistical barplot (gglot) with dependence of response variable
I would like to create and save advanced statistical barplot with help of loop function. I would like to change response variable for statistical analyses (using loop), names of y axis and maximum limit for ... | https://stackoverflow.com/questions/77129613/function-loop-for-creating-and-saving-advanced-statistical-barplot-gglot-with | r, ggplot2, statistics | 1,695,061,497 |
se_77119655 | stackoverflow | DATA_SCIENCE | Mesaure CPU usage of python code, running through CMD | Mesaure CPU usage of python code, running through CMD
I created a tool written in Python code, and I wanted to measure how much percentage my code is using from the CPU.
Is there a way to do this ?
I have tried several solutions online, and it just prints the current CPU usage ( as the one seen in Task Manager ).
I am... | https://stackoverflow.com/questions/77119655/mesaure-cpu-usage-of-python-code-running-through-cmd | python, statistics, cpu, cpu-usage | 1,694,899,358 |
se_689827 | stackoverflow | DATA_SCIENCE | Realistic time estimates for progress bars etc | Realistic time estimates for progress bars etc
I know I am not the only one who does not like progress bars or time estimates which give unrealistic estimates in software. Best examples are installers which jump from 0% to 90% in 10 seconds and then take an hour to complete the final 10%.
Most of the time programmers... | https://stackoverflow.com/questions/689827/realistic-time-estimates-for-progress-bars-etc | language-agnostic, statistics, progress-bar, machine-learning, estimation | 1,238,161,649 |
se_26079881 | stackoverflow | DATA_SCIENCE | KL-Divergence of two GMMs | KL-Divergence of two GMMs
I have two GMMs that I used to fit two different sets of data in the same space, and I would like to calculate the KL-divergence between them.
Currently I am using the GMMs defined in sklearn (http://scikit-learn.org/stable/modules/generated/sklearn.mixture.GMM.html) and the SciPy implementa... | https://stackoverflow.com/questions/26079881/kl-divergence-of-two-gmms | python, numpy, statistics, scipy, scikit-learn | 1,411,857,897 |
se_60613233 | stackoverflow | DATA_SCIENCE | What does 'frozen distribution' mean in Scipy? | What does 'frozen distribution' mean in Scipy?
In the documentation of scipy, the 'frozen pdf', etc, is mentioned sometimes, but I don't know the meaning of it? Is it a statistical concept or scipy terminology? | https://stackoverflow.com/questions/60613233/what-does-frozen-distribution-mean-in-scipy | python, scipy, statistics | 1,583,825,799 |
se_72813471 | stackoverflow | DATA_SCIENCE | Finding the local maxima and local minima | Finding the local maxima and local minima
Data:
+---------------------+------------------+--+
| date_add | fnv_wa | |
+---------------------+------------------+--+
| 2022-06-24 06:00:16 | 46.216866 | |
| 2022-06-24 07:00:16 | 46.216866 | |
| 2022-06-24 08:00:16 | 45.685139 ... | https://stackoverflow.com/questions/72813471/finding-the-local-maxima-and-local-minima | python, pandas, machine-learning, statistics | 1,656,581,658 |
se_77106665 | stackoverflow | DATA_SCIENCE | R GauPro Package: Why are there only two parameters estimated? | R GauPro Package: Why are there only two parameters estimated?
So this package uses the Gaussian (which I believe is the squared exponential) covariance function. But by default, only two parameters are optimized: "theta" and "nugget". Shouldn't there be three parameters in a Gaussian process? It appears that the vari... | https://stackoverflow.com/questions/77106665/r-gaupro-package-why-are-there-only-two-parameters-estimated | r, statistics, gaussian-process | 1,694,707,484 |
se_61258512 | stackoverflow | DATA_SCIENCE | Python geopandas - how to aggregate (or do some other statistics) values of points within a polygon? | Python geopandas - how to aggregate (or do some other statistics) values of points within a polygon?
I have an issue with geopandas and cannot come up with a smart solution myself...
I do have two geopandas dataframes. One contains point geometries (e.g. cities), the other polygon geometries (e.g. countries). Each po... | https://stackoverflow.com/questions/61258512/python-geopandas-how-to-aggregate-or-do-some-other-statistics-values-of-poin | python, statistics, polygon, spatial, geopandas | 1,587,065,334 |
se_55753461 | stackoverflow | DATA_SCIENCE | How to iteratively compute p-values for t-test | How to iteratively compute p-values for t-test
a) Generate 50 values from X ~ N (μX= 25, σX = 4) and 50 values from Y ~ N (μY= 25, σY = 4). Use a t-test to test for equality of the means.
c) Repeat part (a) 2500 times, and retain the p-value for each of the 2500 tests. Each repetition should generate a new sample fo... | https://stackoverflow.com/questions/55753461/how-to-iteratively-compute-p-values-for-t-test | r, statistics, hypothesis-test | 1,555,620,064 |
se_22789852 | stackoverflow | DATA_SCIENCE | gnuplot xvalue of maximum of y | gnuplot xvalue of maximum of y
I have a file made of three columns, x, y1 and y2. I need to know the value at which y2 has a maximum. To find the maximum of y2 is easy:
stats 'test2-EDB.dat' u 3
from which I know that the y2 has a maximum on the 6779th line of the file
STATS_index_max = 6779.0
However, what I ne... | https://stackoverflow.com/questions/22789852/gnuplot-xvalue-of-maximum-of-y | statistics, gnuplot | 1,396,364,924 |
se_77100194 | stackoverflow | DATA_SCIENCE | gnuplot for which x the y is maximum | gnuplot for which x the y is maximum
In Gnuplot, I want to obtain from stats the value of x where the y attains maximum. The solution here uses a very clever trick. This solution only works without setting xrange. If I have a spike in data at the begining which i want to avoid, I want to set xrange [200:1000] and then... | https://stackoverflow.com/questions/77100194/gnuplot-for-which-x-the-y-is-maximum | statistics, gnuplot | 1,694,635,647 |
se_77098614 | stackoverflow | DATA_SCIENCE | Plot residuals vs. predictor variable in the R programming language | Plot residuals vs. predictor variable in the R programming language
I have the SLR model in R
model<-lm(Y~X,data)
I need to make a plot both of Residuals vs. Yhat and Residuals vs. predictor. Yes, I know that they provide the same information and yes, I need to make both anyway.
I know I can get residual vs. Yhat fro... | https://stackoverflow.com/questions/77098614/plot-residuals-vs-predictor-variable-in-the-r-programming-language | r, statistics, linear-regression | 1,694,619,986 |
se_77091337 | stackoverflow | DATA_SCIENCE | Mixed effects logistic regression results in singular hessian and bad fitted model in R | Mixed effects logistic regression results in singular hessian and bad fitted model in R
Apologies if I'm missing anything obvious but I have this very simple dataset (just for illustration of the problem I'm encountering):
15 participants, 3 conditions, each participant experienced all 3 conditions and produced a bina... | https://stackoverflow.com/questions/77091337/mixed-effects-logistic-regression-results-in-singular-hessian-and-bad-fitted-mod | r, statistics, logistic-regression, anova, mixed-models | 1,694,538,882 |
se_77087759 | stackoverflow | DATA_SCIENCE | How to calculate the total proportional change in abundance based on GLMM predicted values in R? | How to calculate the total proportional change in abundance based on GLMM predicted values in R?
I am now dealing with the analysis of a long term bird survey, that was conducted every 3 years since 2004. For each species, I used lme4 package to fit a GLMM with the abundance as the response variable, year and sampling... | https://stackoverflow.com/questions/77087759/how-to-calculate-the-total-proportional-change-in-abundance-based-on-glmm-predic | r, statistics, lme4, proportions, glmm | 1,694,510,635 |
se_63073951 | stackoverflow | DATA_SCIENCE | What does setting the 'contamination' parameter to 'auto' in Sklearn Outlier Detection methods do? | What does setting the 'contamination' parameter to 'auto' in Sklearn Outlier Detection methods do?
I have a dataset where I need to be able to control to what extent the Outlier Detection Model (Isolation Forest, Elliptic Envelope, OneClassSVM...) considers a given point an outlier or not (something si... | https://stackoverflow.com/questions/63073951/what-does-setting-the-contamination-parameter-to-auto-in-sklearn-outlier-det | python, scikit-learn, statistics, outliers, anomaly-detection | 1,595,595,112 |
se_76928651 | stackoverflow | DATA_SCIENCE | Percentage of pixels with a specific value | Percentage of pixels with a specific value
Is there a transformer that extract me the percentage of pixels with a specific value, and shows it as an attribute? My reader would be a TIFF and the writer would be a CSV file, with the attribute of percentage of black pixels per band.
I have other attributes, result from R... | https://stackoverflow.com/questions/76928651/percentage-of-pixels-with-a-specific-value | python, image-processing, statistics, pixel, raster | 1,692,355,814 |
se_43482592 | stackoverflow | DATA_SCIENCE | R: Is there an equivalent to Stata's codebookout command? | R: Is there an equivalent to Stata's codebookout command?
In Stata I am able to use the codebookout command to create an Excel workbook that saves name, label, and storage type of all the variables in the existing dataset with their corresponding values and value labels.
I would like to find an equivalent functi... | https://stackoverflow.com/questions/43482592/r-is-there-an-equivalent-to-statas-codebookout-command | r, excel, statistics, stata | 1,492,551,311 |
se_77078084 | stackoverflow | DATA_SCIENCE | Creating an epidemiological prevalence table in R using dataset | Creating an epidemiological prevalence table in R using dataset
I have previously created a prevalence table in SAS but I am trying to replicate it in R. I have attached description and image of target table below.
I having trouble creating a simple table the shows prevalence by age and sex. I have tried using various... | https://stackoverflow.com/questions/77078084/creating-an-epidemiological-prevalence-table-in-r-using-dataset | r, statistics, analytics, gtsummary | 1,694,384,545 |
se_77077459 | stackoverflow | DATA_SCIENCE | Quantile function Julia vs Matlab | Quantile function Julia vs Matlab
I just recently came accross that there is different defition of quantile() in Julia and Matlab.
I was unable to align the two definitions and always get different result.
Does anybody know why is this a case and how to align their definitions?
I tried the following:
A = [0.5377, 1... | https://stackoverflow.com/questions/77077459/quantile-function-julia-vs-matlab | matlab, statistics, julia, quantile | 1,694,371,320 |
se_57014336 | stackoverflow | DATA_SCIENCE | How to plot a linear regression to a segment of a line | How to plot a linear regression to a segment of a line
I have some data plotted as lines with matplotlib that are 250 points long. I can fit the whole data sets. However, I wish to fit and plot a regression line to just the last 50 data points using least squares. What is the best approach? (My plot code below.)
j = ... | https://stackoverflow.com/questions/57014336/how-to-plot-a-linear-regression-to-a-segment-of-a-line | python, matplotlib, statistics | 1,562,967,901 |
se_77076311 | stackoverflow | DATA_SCIENCE | Incorrect median and mode | Incorrect median and mode
Details of the problem are mentioned below:
#include <stdio.h>
int main() {
int N, i, j, sum, mode, count, f[100], maxf;
float mean, med;
printf("Enter the number of students\n");
scanf("%d", &N);
printf("Number of students:%d\n", N);
int m[N]; // Array to store t... | https://stackoverflow.com/questions/77076311/incorrect-median-and-mode | c, statistics, median | 1,694,352,473 |
se_77064673 | stackoverflow | DATA_SCIENCE | Sample selection model | Sample selection model
I want to duplicate the resuls of sampleSelection package. However, my code does not work.
Data Set
library(mvtnorm)
set.seed(123)
n = 1000
sigmau <- 1; sigmav <- 1; rho <- 0.5
Sigma <- matrix(c(sigmau^2,rho*sigmau*sigmav,rho*sigmau*sigmav,sigmav^2),2,2)
x1 <- rnorm(n,0,1); x2 <- rnorm(n,0,1); ... | https://stackoverflow.com/questions/77064673/sample-selection-model | r, optimization, statistics, sample, mle | 1,694,155,142 |
se_8500701 | stackoverflow | DATA_SCIENCE | robust online algorithm for semi-variance | robust online algorithm for semi-variance
I'm looking for the equivalent of welford's algorithm for the online computation semi-variance (downside partial variance). Does anyone know of a good reference? Does such an algorithm even exist?
Edit: the case where the semi-variance is taken relative to a fixed target is t... | https://stackoverflow.com/questions/8500701/robust-online-algorithm-for-semi-variance | algorithm, math, statistics, numerical | 1,323,846,848 |
se_77070947 | stackoverflow | DATA_SCIENCE | Julia: what is the peformance difference between for-loop and map in mathematical optimization? | Julia: what is the peformance difference between for-loop and map in mathematical optimization?
I have developed two code implementations to optimize a quadratic function. One utilizes a for loop, while the other employs a map function. Despite the similarity in appearance between the two codes, the one using the map ... | https://stackoverflow.com/questions/77070947/julia-what-is-the-peformance-difference-between-for-loop-and-map-in-mathematica | performance, optimization, statistics, julia | 1,694,237,015 |
se_77069718 | stackoverflow | DATA_SCIENCE | How to add row with confidence intervals for each column using gtsummary | How to add row with confidence intervals for each column using gtsummary
I am trying to get confidence intervals for each colum in dataset(W,S,F,LF) by addding a row at the end of the table. Is it possible to do this using the gtsummary package?
library(gtsummary)
a <- structure(list(SampleDate = structure(c(15710, 1... | https://stackoverflow.com/questions/77069718/how-to-add-row-with-confidence-intervals-for-each-column-using-gtsummary | r, dplyr, statistics, confidence-interval, gtsummary | 1,694,205,049 |
se_2618248 | stackoverflow | DATA_SCIENCE | How can I make the output from tapply() into a data.frame | How can I make the output from tapply() into a data.frame
I have a data.frame in R that looks like this:
score rms template aln_id description
1 -261.410 4.951 2f22A.pdb 2F22A_1 S_00001_0000002_0
2 -231.987 21.813 1wb9A.pdb 1WB9A_4 S_00002_0000002_0
3 -263.722 4.903 2f22A.pdb 2F22A_3 S_00003... | https://stackoverflow.com/questions/2618248/how-can-i-make-the-output-from-tapply-into-a-data-frame | r, statistics | 1,271,011,728 |
se_64192772 | stackoverflow | DATA_SCIENCE | Why do coefficient of determination, R², implementations produce different results? | Why do coefficient of determination, R², implementations produce different results?
When attempting to implement a python function for calculating the coefficient of determination, R², I noticed I got wildly different results depending on whose calculation sequence I used.
The wikipedia page on R² gives a seeming... | https://stackoverflow.com/questions/64192772/why-do-coefficient-of-determination-r%c2%b2-implementations-produce-different-resul | python, numpy, statistics, coefficient-of-determination | 1,601,801,794 |
se_77053193 | stackoverflow | DATA_SCIENCE | How to handle irregular time series charting | How to handle irregular time series charting
I have some data I'm getting from an api and graphing it. This is a sample of the data
[
{
"id": 10516560,
"username": "acrawford69",
"avatar_url": "https://a.ppy.sh/10516560?1661994504.png",
"country_code": "US",
"country": {
... | https://stackoverflow.com/questions/77053193/how-to-handle-irregular-time-series-charting | javascript, typescript, charts, statistics, echarts | 1,694,012,816 |
se_77049974 | stackoverflow | DATA_SCIENCE | Outliers detection. Curve fitting (i.e., LOWESS,LOESS, etc. with confidence intervals) or any other applicable approach in MATLAB | Outliers detection. Curve fitting (i.e., LOWESS,LOESS, etc. with confidence intervals) or any other applicable approach in MATLAB
I am trying to automatically detect some data point in my x,y scatterplots. I have thousands of them, so I need to implement an approach that has a good trade-off between accuracy and sensi... | https://stackoverflow.com/questions/77049974/outliers-detection-curve-fitting-i-e-lowess-loess-etc-with-confidence-inte | matlab, statistics, scatter-plot, outliers, anomaly-detection | 1,693,986,813 |
se_77046563 | stackoverflow | DATA_SCIENCE | Using breakpoint analysis to estimate thermocline presence & depth in ponds (r) | Using breakpoint analysis to estimate thermocline presence & depth in ponds (r)
Desperate environmental engineering PhD candidate here... (Please forgive formatting issues, etc. - This is my first post!)
Objective: In my field study, I measured temperature with pond depth. I want to use these high-frequency data t... | https://stackoverflow.com/questions/77046563/using-breakpoint-analysis-to-estimate-thermocline-presence-depth-in-ponds-r | r, statistics, breakpoints, piecewise | 1,693,934,671 |
se_77042992 | stackoverflow | DATA_SCIENCE | Sum of two dependent random variables | Sum of two dependent random variables
I am trying to find (or at least sketch) on distribution of two exponential distributions with different parameters.
Under independence, it becomes very easy using convolution and joint distribution (which would be the multiplication of marginals).
However, if independence is not ... | https://stackoverflow.com/questions/77042992/sum-of-two-dependent-random-variables | statistics, probability | 1,693,903,270 |
se_51120555 | stackoverflow | DATA_SCIENCE | Fitting a non-linear univariate regression to time-series data | Fitting a non-linear univariate regression to time-series data
I've recently started machine learning using python. Below is a dataset I picked up as an example along with the codes I've worked on till now. Chosen [2000....2015] as the test data and train data [2016, 2017].
Dataset
Years Values
0 ... | https://stackoverflow.com/questions/51120555/fitting-a-non-linear-univariate-regression-to-time-series-data | python, scikit-learn, statistics, regression, non-linear-regression | 1,530,421,496 |
se_75311118 | stackoverflow | DATA_SCIENCE | Converting a simple df to a ts object that is aggregated by year | Converting a simple df to a ts object that is aggregated by year
I have a df of the following:
structure(list(Type = c("Type 1", "Type 1", "Type 1", "Type 1",
"Type 1", "Type 1", "Type 1", "Type 1", "Type 1", "Type 1", "Type 1",
"Type 1", "Type 1", "Type 1", "Type 1", "Type 1", "Type 1", "Type 1",
"Type 1", "Type 1... | https://stackoverflow.com/questions/75311118/converting-a-simple-df-to-a-ts-object-that-is-aggregated-by-year | r, dataframe, statistics | 1,675,259,160 |
se_77036724 | stackoverflow | DATA_SCIENCE | Curve intercept as text on y-axis: ggplot2 | Curve intercept as text on y-axis: ggplot2
I'm trying to put the model's intercept value on the y-axis.
The code I'm using is this:
library(ggplot2)
mod <- lm(circumference ~ age + I(age^2), Orange); summary(mod)
novo_dados <- data.frame(age = seq(0, max(Orange$age), length.out = 100))
valores_previstos <- predict(mo... | https://stackoverflow.com/questions/77036724/curve-intercept-as-text-on-y-axis-ggplot2 | r, ggplot2, graph, graphics, statistics | 1,693,821,221 |
se_77034044 | stackoverflow | DATA_SCIENCE | In R, how to analyze Strip-Plot Design when there are three factors? | In R, how to analyze Strip-Plot Design when there are three factors?
I have one dataset like below
dataA= structure(list(sowing_date= c("Early", "Early", "Early",
"Early", "Early", "Early",
"Early", "Early", "Early",
... | https://stackoverflow.com/questions/77034044/in-r-how-to-analyze-strip-plot-design-when-there-are-three-factors | r, plot, statistics, experimental-design | 1,693,772,458 |
se_77031981 | stackoverflow | DATA_SCIENCE | How to return the most common files extensions form a list of filenames? | How to return the most common files extensions form a list of filenames?
I was given lists, that contains filenames with extensions, and asked to write a function to count the most common extension in every list, and return the results.
Example:
["direful.pr", "festive.html", "historical.wav", "holistic.mp3", "impossi... | https://stackoverflow.com/questions/77031981/how-to-return-the-most-common-files-extensions-form-a-list-of-filenames | python, statistics, counting | 1,693,738,764 |
se_77026490 | stackoverflow | DATA_SCIENCE | Obtaining proportions and confidence intervals with prop.test() for multiple groups in R | Obtaining proportions and confidence intervals with prop.test() for multiple groups in R
I need to get the positivity rate by county for multiple drugs and multiple counties. The real data includes more drugs and more counties. The NA values mean that the test was not ordered so they should not be counted as the total... | https://stackoverflow.com/questions/77026490/obtaining-proportions-and-confidence-intervals-with-prop-test-for-multiple-gro | r, statistics, confidence-interval, rate, proportions | 1,693,613,702 |
se_77029018 | stackoverflow | DATA_SCIENCE | Uniform random sampling not returning uniform samples (Scipy uniform) | Uniform random sampling not returning uniform samples (Scipy uniform)
I'm setting up an experiment that requires 10 variables to be uniformly distributed between -pi and pi. This should be fairly trivial, using scipy.
Details:
Python 3.8.16
NumPy 1.24.2
SciPy 1.10.1
Note: The Python version cannot exceed 3.8.16 due to... | https://stackoverflow.com/questions/77029018/uniform-random-sampling-not-returning-uniform-samples-scipy-uniform | python, numpy, debugging, scipy, statistics | 1,693,670,921 |
se_76957205 | stackoverflow | DATA_SCIENCE | Why overlaying Beta distribution on a histogram fails for small sample sizes? | Why overlaying Beta distribution on a histogram fails for small sample sizes?
For those without a statistics background but who could assist with coding: I have multiple small datasets (around 30 to 200 rows each) and need to determine the best-fitting distribution. One approach is visual inspection, Here I focus on t... | https://stackoverflow.com/questions/76957205/why-overlaying-beta-distribution-on-a-histogram-fails-for-small-sample-sizes | r, ggplot2, statistics, probability-density, beta-distribution | 1,692,743,573 |
se_77018227 | stackoverflow | DATA_SCIENCE | Writing continuous stats of sorted data in R | Writing continuous stats of sorted data in R
new to R so apologies if the question is dumb. I have a dataset of historical ordered data, lets say games in a league and players making or missing shots.
GAME_ID
EVENT_ID
EVENT_TYPE
PLAYER_ID
1
1
MADE_SHOT
25
1
2
MADE_SHOT
22
1
3
MISSED_SHOT
25
1
4
MADE_SHOT... | https://stackoverflow.com/questions/77018227/writing-continuous-stats-of-sorted-data-in-r | r, statistics | 1,693,504,386 |
se_1930454 | stackoverflow | DATA_SCIENCE | What is a good solution for calculating an average where the sum of all values exceeds a double's limits? | What is a good solution for calculating an average where the sum of all values exceeds a double's limits?
I have a requirement to calculate the average of a very large set of doubles (10^9 values). The sum of the values exceeds the upper bound of a double, so does anyone know any neat little tricks for calculatin... | https://stackoverflow.com/questions/1930454/what-is-a-good-solution-for-calculating-an-average-where-the-sum-of-all-values-e | java, algorithm, statistics | 1,261,167,528 |
se_28115637 | stackoverflow | DATA_SCIENCE | How to better fit seaborn violinplots | How to better fit seaborn violinplots
The following code gives me a very nice violinplot (and boxplot within).
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
foo = np.random.rand(100)
sns.violinplot(foo)
plt.boxplot(foo)
plt.show()
So far so good. However, when I look at foo, the varia... | https://stackoverflow.com/questions/28115637/how-to-better-fit-seaborn-violinplots | python, statistics, seaborn, kernel-density, violin-plot | 1,422,034,932 |
se_77017085 | stackoverflow | DATA_SCIENCE | Derive pandas ewm.std formula | Derive pandas ewm.std formula
According to this answer https://stackoverflow.com/a/50236294/10870191, the formula pandas uses for ewma.std is
mrt_array = np.array(mrt.tolist())
M = len(mrt_array)
weights = (1-a)**np.arange(M-1, -1, -1) # This is reverse order to match Series order
ewma = sum(weights * mrt_array) / sum... | https://stackoverflow.com/questions/77017085/derive-pandas-ewm-std-formula | python, pandas, statistics | 1,693,494,401 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.