quartile

cox proportional hazard regression in SPSS using reference group

北城以北 提交于 2021-02-11 15:15:35
问题 I am running cox proportional hazard regression in SPSS to see the association of 'predictor' with risk of a disease in a 10 years follow-up. I have another variable 'age_quartiles' with values 1,2,3,4 and want to use '1' as reference to get HRs for 2,3, and 4 relative to '1'. When I put this variable in Strata I still get one 'HR' as follows ('S_URAT_07' is the predictor with continuous values); Question: How do I get HRs for the predictor for the event based on 'age_quartiles' 2,3 and 4 and

Python: Get array indexes of quartiles

喜欢而已 提交于 2021-02-08 09:15:56
问题 I am using the following code to calculate the quartiles of a given data set: #!/usr/bin/python import numpy as np series = [1,2,2,2,2,2,2,2,2,2,2,5,5,6,7,8] p1 = 25 p2 = 50 p3 = 75 q1 = np.percentile(series, p1) q2 = np.percentile(series, p2) q3 = np.percentile(series, p3) print('percentile(' + str(p1) + '): ' + str(q1)) print('percentile(' + str(p2) + '): ' + str(q2)) print('percentile(' + str(p3) + '): ' + str(q3)) The percentile function returns the quartiles, however, I would also like

Python: Get array indexes of quartiles

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-08 09:15:44
问题 I am using the following code to calculate the quartiles of a given data set: #!/usr/bin/python import numpy as np series = [1,2,2,2,2,2,2,2,2,2,2,5,5,6,7,8] p1 = 25 p2 = 50 p3 = 75 q1 = np.percentile(series, p1) q2 = np.percentile(series, p2) q3 = np.percentile(series, p3) print('percentile(' + str(p1) + '): ' + str(q1)) print('percentile(' + str(p2) + '): ' + str(q2)) print('percentile(' + str(p3) + '): ' + str(q3)) The percentile function returns the quartiles, however, I would also like

Python: Get array indexes of quartiles

随声附和 提交于 2021-02-08 09:13:57
问题 I am using the following code to calculate the quartiles of a given data set: #!/usr/bin/python import numpy as np series = [1,2,2,2,2,2,2,2,2,2,2,5,5,6,7,8] p1 = 25 p2 = 50 p3 = 75 q1 = np.percentile(series, p1) q2 = np.percentile(series, p2) q3 = np.percentile(series, p3) print('percentile(' + str(p1) + '): ' + str(q1)) print('percentile(' + str(p2) + '): ' + str(q2)) print('percentile(' + str(p3) + '): ' + str(q3)) The percentile function returns the quartiles, however, I would also like

Python: Get array indexes of quartiles

馋奶兔 提交于 2021-02-08 09:13:01
问题 I am using the following code to calculate the quartiles of a given data set: #!/usr/bin/python import numpy as np series = [1,2,2,2,2,2,2,2,2,2,2,5,5,6,7,8] p1 = 25 p2 = 50 p3 = 75 q1 = np.percentile(series, p1) q2 = np.percentile(series, p2) q3 = np.percentile(series, p3) print('percentile(' + str(p1) + '): ' + str(q1)) print('percentile(' + str(p2) + '): ' + str(q2)) print('percentile(' + str(p3) + '): ' + str(q3)) The percentile function returns the quartiles, however, I would also like

Access 25%, 50%, 75% Quartiles (Data From Query and Result Destination is a Report)

旧巷老猫 提交于 2021-02-05 08:09:17
问题 The data that I need the quartiles is a query with the first column being the month-year and the second column being a count of defects for that month. I am looking to have the quartiles to be displayed on a report (Name: QE Quartile Test). Query name: QE Test Count Step 2 Columns names: ProductionYM ; Claims The following code is something I found online but I don't code much so I don't know where to go from here. Public Function XPercentile() XPercentile = DMin(Claims, QETest, "DCount(""*""

Which method does pandas use for percentile?

牧云@^-^@ 提交于 2020-01-24 15:56:49
问题 I was trying to understand lower/upper percentiles calculation in pandas and got a bit confused. Here is the sample code and output for it. test = pd.Series([7, 15, 36, 39, 40, 41]) test.describe() output: I am interested in only 25%, 75% percentiles. I wonder which method does pandas use to calculate them? Referring to https://en.wikipedia.org/wiki/Quartile the article, results are different as following: So what statistical/mathematical method does pandas uses to calculate percentile? 回答1:

Trying to calculate quartiles in MDX

与世无争的帅哥 提交于 2020-01-11 13:32:53
问题 My data looks like this: ID |PersonID |CompanyID |DateID |Throughput |AmountType 33F467AC-F35B-4F24-A05B-FC35CF005981 |7 |53 |200802 |3 |0 04EE0FF0-511D-48F5-AA58-7600B3A69695 |18 |4 |201309 |5 |0 AB058AA5-6228-4E7C-9469-55827A5A34C3 |25 |69 |201108 |266 |0 with around a million rows. The columns names *ID refers to other tables, so they can be used as dimensions. I have an OLAP cube with the column Throughput as Measure and the rest as dimensions. I want to calculate Quartile 1 and 3 of the

Pandas Getting Upper and Lower Fences For Each Rows

ぐ巨炮叔叔 提交于 2019-12-24 06:29:40
问题 My input dataframe is; Grp A B C Men 10 15 20 Women 15 10 25 Baby 5 10 20 Men 3 8 25 Men 7 5 30 Baby 5 2 8 Women 10 6 3 How can i get this upper and lower fences for unique groups? Desired Output is; GRP Upper_A Lower_A Upper_B Lower_B Upper_C Lower_C Men Women Baby Could you please help me about this? PS: Upper and lower values are box and whisker values. 回答1: Use GroupBy.agg with Series.quantile, specify new columns names and then flatten MultiIndex by f-string s: df = df.groupby('Grp').agg

Plot time series with mean and vertical error bars of interquartile range by column in R

折月煮酒 提交于 2019-12-14 04:14:56
问题 I have a matrix and want to plot vertical error bars of the interquartile range and mean by column from the matrix. How do I do this in R especially ggplot2, please? A sample matrix is given below: ##Create matrix B = matrix (c(2,4,3,1,5,7,5,3,8,3,7,3),nrow=4,ncol=3) ##Create zoo object B2<-as.zoo(B) colnames(B2)<- c("A","B","C") B2 A B C 2 5 8 4 7 3 3 5 7 1 3 3 ##The Dates for the columns: Date<-as.yearmon (seq(as.Date("2000/1/1"), by = "month", length.out = 3)) I want a time series plot but