Transform quantiles output into a table

Advertisements I have this code tapply(index_articles_migpunts$index_articles_ponderats2_migpunts, index_articles_migpunts$Tramspoblacio, quantile, probs=seq(.1,.9, by =.1)) which gives this output: $`1 – 999` 10% 20% 30% 40% 50% 60% 70% 80% 0.0000000 0.8333333 5.0000000 5.0000000 5.8333333 7.8666667 10.0000000 13.3500000 90% 17.1166667 $`1000 – 4999` 10% 20% 30% 40% 50% 60% 70% 80% 90% 5.833333 10.866667 13.300000 16.333333 17.479167 19.200000 20.687500… Read More Transform quantiles output into a table

Why am I not able to remove outliers?

Advertisements # The outlier quantity that should be removed filter(HF2, serum_creatinine >= quantile(serum_creatinine,probs=.75) + ((quantile(serum_creatinine,probs=.75)-quantile(serum_creatinine,probs=.25))*1.5) | creatinine_phosphokinase >= quantile(creatinine_phosphokinase,probs=.75) + ((quantile(creatinine_phosphokinase,probs=.75)-quantile(creatinine_phosphokinase,probs=.25))*1.5)) %>% nrow [1] 56 # The code being used to remove them filter(HF2, serum_creatinine < quantile(serum_creatinine,probs=.75) + ((quantile(serum_creatinine,probs=.75)-quantile(serum_creatinine,probs=.25))*1.5) | creatinine_phosphokinase < quantile(creatinine_phosphokinase,probs=.75) + ((quantile(creatinine_phosphokinase,probs=.75)-quantile(creatinine_phosphokinase,probs=.25))*1.5)) %>% nrow [1] 297 Why am I not able to… Read More Why am I not able to remove outliers?

Pandas qcut ValueError: Input array must be 1 dimensional

Advertisements I was trying to categorize my values into 10 bins and I met with this error. How can I avoid this error and bin them smoothly? Attached are samples of the data and code. Data JPM 2008-01-02 NaN 2008-01-03 NaN 2008-01-04 NaN 2008-01-07 NaN 2008-01-08 NaN … … 2009-12-24 -0.054014 2009-12-28 0.002679 2009-12-29 -0.030015… Read More Pandas qcut ValueError: Input array must be 1 dimensional

Why do quantile function in R gives unequal count of values in each group

Advertisements I am trying to group a continuous value data into tertile. I am using the function quantile to do this. following is my code dd$wbc_tert = with(dd, cut(wbc, vTert, include.lowest = T, labels = c("Low", "Medium", "High"))) Isn’t it supposed to give equal count of values in each group? I am getting different count… Read More Why do quantile function in R gives unequal count of values in each group

I would like to make my program display the order total/invoice

Advertisements Here is what ive done: food =["cheeseburger", "smallchips", "drink"] prices =[2.50, 1.50, 1] x=0 myorderfood=[] myordercost=[] print("Burgers\n") print("Menu:") print("Cheeseburger. Cost – $2.50 each") print("Small chips. Cost – $1.50 each") print("Drink – Cola only. Cost – $1.00 each\n") I want to display an invoice at the end once the user has completed there order showing… Read More I would like to make my program display the order total/invoice

How to use ggplot to make a qqplot to compare the distribution of two variables?

Advertisements I’d like to know how is possible to make a qqplot with ggplot2 that compares two distributions and not a distribution to a theoretical distribution. I want something like this; qqplot(iris$Petal.Length, iris$Petal.Width) that compares the quartiles of Petal.Length and Petal.Width in iris dataset, but using ggplot2. >Solution : One easy way to reproduce the… Read More How to use ggplot to make a qqplot to compare the distribution of two variables?