yesterday
TomHsiung
Pyrite | Level 9
Member since
01-04-2018
- 142 Posts
- 52 Likes Given
- 4 Solutions
- 7 Likes Received
-
Latest posts by TomHsiung
Subject Views Posted 563 a week ago 230 a week ago 231 a week ago 285 a week ago 683 a week ago 684 a week ago 694 a week ago 706 a week ago 714 a week ago 729 a week ago -
Activity Feed for TomHsiung
- Liked Re: PROC Tabulate omit one observation but PROC Univariate not for Kathryn_SAS. a week ago
- Posted Re: PROC Tabulate omit one observation but PROC Univariate not on Statistical Procedures. a week ago
- Posted Re: Two table statements in PROC Tabulate due to different statistics and we want merge them into on on SAS Programming. a week ago
- Posted Re: Two table statements in PROC Tabulate due to different statistics and we want merge them into on on SAS Programming. a week ago
- Liked Re: Two table statements in PROC Tabulate due to different statistics and we want merge them into on for Cynthia_sas. a week ago
- Posted Two table statements in PROC Tabulate due to different statistics and we want merge them into one on SAS Programming. a week ago
- Posted Re: PROC Tabulate omit one observation but PROC Univariate not on Statistical Procedures. a week ago
- Posted Re: PROC Tabulate omit one observation but PROC Univariate not on Statistical Procedures. a week ago
- Posted Re: PROC Tabulate omit one observation but PROC Univariate not on Statistical Procedures. a week ago
- Posted Re: PROC Tabulate omit one observation but PROC Univariate not on Statistical Procedures. a week ago
- Posted Re: PROC Tabulate omit one observation but PROC Univariate not on Statistical Procedures. a week ago
- Posted PROC Tabulate omit one observation but PROC Univariate not on Statistical Procedures. a week ago
- Posted Re: Did SAS Viya for Learners update the rule for naming the column when importing from xlsx on SAS Programming. 2 weeks ago
- Posted Did SAS Viya for Learners update the rule for naming the column when importing from xlsx on SAS Programming. 2 weeks ago
- Liked Re: Can we do the approximately unbiased estimator for the probability density function of cont. var for Season. 04-07-2025 08:12 AM
- Posted Re: Can we do the approximately unbiased estimator for the probability density function of cont. var on Statistical Procedures. 04-07-2025 06:32 AM
- Liked Re: Can we do the approximately unbiased estimator for the probability density function of cont. var for FreelanceReinh. 04-07-2025 05:10 AM
- Liked Re: Can we do the approximately unbiased estimator for the probability density function of cont. var for Season. 04-07-2025 02:10 AM
- Posted Re: Can we do the approximately unbiased estimator for the probability density function of cont. var on Statistical Procedures. 04-06-2025 11:31 AM
- Liked Re: Can we do the approximately unbiased estimator for the probability density function of cont. var for Season. 04-06-2025 07:45 AM
-
Posts I Liked
Subject Likes Author Latest Post 3 1 1 3 1 -
My Liked Posts
Subject Likes Posted 1 04-05-2025 03:22 AM 1 04-04-2025 10:20 AM 1 04-04-2025 09:36 AM 2 04-23-2024 02:51 AM 2 04-19-2024 11:38 AM
05-09-2024
07:50 AM
Hello, everyone
I managed to estimate the parameters for a Weibull accelerated failure time model from the PROC LIFEREG procedure. I have the point and interval estimations for predictor coefficients. In addition, I have the estimations for the Weibull shape parameter.
After I get these estimations, I would like to simulate the cumulative incidence curve/survival curve. I know I should use the point estimation of these coefficients and the shape parameter in the prediction model. But I am not sure whether to use the interval estimation of coefficients, or the shape parameter.
You answer is much appreciated!
... View more
04-23-2024
02:51 AM
2 Likes
Hi, Ksharp
Thanks for your feedback. However, I don't see it that way. The stddev is the standard deviation of the predictor and the predictor can only be 1 or 0, given the predictor represents the trial with only 2 arms (e.g., drug vs placebo). A predictor of binomial distribution does not have to be only either 1 or 0, it can be any integer. Therefore, the distribution of the predictor is a Bernoulli distribution, not a binomial distribution. My first post made the mistake and it should have been Bernoulli distribution.
Regards,
... View more
04-22-2024
05:46 AM
Sorry, it should be a Bernoulli distribution. Each observation in this case either receives the drug or not. Therefore, the random variable is either 1 or 0. The random variable of a binomial distribution can have numbers other than 0 or 1. It should have been Bernoulli distribution.
... View more
04-22-2024
05:42 AM
Yes. And in your case, the maximum value of the square root is 0.50.
... View more
- Tags:
- wrong
04-22-2024
12:58 AM
I misunderstood the meaning of the option stddev. It is not the standard error of the regression coefficient of the predictor of interest, it should be the standard deviation of the predictor itself. If, for instance, the predictor is a binary intervention arm variable (e.g., drug vs placebo), the stddev should be square root of p(1-p), with p be the proportion of an arm.
Here is the final result of this trial, the trail has a 1:1 randomization, so p is 0.5 and the square root of 0.5*(1-0.5) is 0.5 too. Much appreciate your help.
... View more
04-22-2024
12:46 AM
Hello, Freelance
I think you're right. The default value of stddev is 0.5, which is the standard deviation of a binary 1:1 match grouping variable, i.e., square root of 0.5(1 - 0.5). Thank you.
... View more
04-21-2024
07:31 AM
Hi, everyone
I met a trouble when doing with the power and sample size stuff with PROC POWER coxreg procedure. I am not sure about the values of the option stddev. I compute its value from the study's HR confidence interval via (logHRupper - logHRlower)/(2 x 1.96). I know this is a standard error but I don't know how to derive the standard deviation of it.
I also have used Stata to compare my results. Same problem. The values of stddev I configured must have been wrong. How could a 80% power require so much events number?
... View more
04-21-2024
02:18 AM
Hello, Rick. I am not sure about the parameter stddev. Is it the standard error of a coefficient estimate from a PROC PHREG procedure, or something different? Thanks.
... View more
04-20-2024
09:37 AM
Hi, ballardw. Thank you for your feedback. I understand where you are coming from, but I need to clarify that my intention is to estimate the actual power of the study after we have the actual events observed. This helps to evaluate the risk of type II error of this study.
... View more
04-20-2024
09:28 AM
The formula has a big error.
%let se = %sysevalf((&lnHrupper - &lnHrLower)/2*1.96);
This is wrong. The correct should be,
%let se = %sysevalf((&lnHrupper - &lnHrLower)/(2*1.96));
I am not 100% sure about what the parameter of stddev should be. I think it is the standard deviation of logHR which approximately has a normal distribution. Based on this understanding, I constructed the formula to calculate the value, by
(UpperCI - LowerCI)/(2 x 1.96)
... View more
- Tags:
- e
04-19-2024
11:38 AM
2 Likes
Hi, ballardw
Thanks for your feedback. I think I had misunderstood the meaning of the parameter
stddev=&se
The value of the stddev should not be derived from the observed confidence interval, i.e., se = (log(hrUpper) - log(hrLower)/(2*1.96))
%let hrUpper = 1.08;
%let hrLower = 0.60;
Instead, the values of hrUpper and hrLower are the presumed boundary of the confidence interval. My code is wrong, because I presume a significance difference, but I inputted a HR confidence across 1.0, obviously. I think the stddev parameter controls the presumed width of confidence intervals. Therefore, the narrower the width (more precise), the more sample observations are required.
Above is my present understanding of the PROC POWER with coxreg statement. I corrected my code as follow,
%macro P;
%let evTotal = 184; /*Event actually occurred*/
%let hr = 0.90 0.80 0.70; /*Presumed true HRs*/
%let desPower = 0.80 0.90; /*Power goals*/
%let hrUpper = 1.00; /*Presumed upper CI boundary of HR*/
%let hrLower = 0.50; /*Presumed lower CI boundary of HR*/
%let lnHrUpper = %sysfunc(log(&hrUpper));
%let lnHrLower = %sysfunc(log(&hrLower));
%let se = %sysevalf((&lnHrupper - &lnHrLower)/2*1.96);
%put The value of lnHrUpper is &lnHrUpper;
%put The value of lnHrLower is &lnHrLower;
%put The value of se is &se;
ods pdf file = '/home/tomhsiung0/Academic/powerCalc.pdf';
proc power;
coxreg
hazardratio = &hr
stddev=&se
eventstotal = &evTotal
power = .
;
run;
proc power;
coxreg
hazardratio = &hr
stddev=&se
eventstotal = .
power = &desPower
;
run;
ods pdf close;
%mend;
%p;
With a result of,
So, we have a power of 90.8% to detect a presumed HR of 0.70, with presumed CI of 0.50-1.00 (stddev = 0.679284). And the fact is we did not get this result, so we are 90.8% sure the true HR is larger than 0.70
... View more
- Tags:
- i
04-19-2024
07:28 AM
Trial paper address: https://www.nejm.org/doi/10.1056/NEJMoa2303062
I expected a much higher power. And it seems wrong because this code produces results that the smaller the standard deviation, the larger events it requires.
My code:
%let evTotal = 184;
%let desPower = 0.80 0.90;
%let hrUpper = 1.08;
%let hrLower = 0.60;
%let se = 0.1499;
%macro P;
ods pdf file = '/home/tomhsiung0/Academic/powerCalc.pdf';
proc power;
coxreg
hazardratio = 1.05 1.50 2.0
stddev=&se
eventstotal = &evTotal
power = .
;
run;
proc power;
coxreg
hazardratio = 1.05 1.50 2.0
stddev=&se
eventstotal = .
power = &desPower
;
run;
ods pdf close;
%mend;
%p;
Results (probably wrong):
... View more
04-09-2024
09:23 AM
Hi, Jacob and all responders
Thank you for answering my question. Yep, so far I now this matrix method could be used to estimation the interval estimation of regression coefficients. However, I would like to understand the proof of this method because it is so fundamental and important for regression technology.
Tom
... View more
04-08-2024
10:30 AM
proc lifereg data = d202_raw order = formatted;
format x1 x2 x3 x4 x5 grpfmt.;
class x2 x3 x4;
model time*censor(0) = x1 x2 x3 x4 x5 / distribution = weibull;
run;
The PROC LIFEREG procedure does tell me the coefficients for variables and the Weibull shape. However, now I would like to draw the survival function curve with a confidence interval. The point estimation is easy to figure out by inputting the point estimations of these variables and the Weibull shape parameter. However, how to figure out the confidence interval of the survival curve? Hitherto, I only used the lower and upper limits of the Weibull shape parameter to do so. Much appreciated.
... View more
04-03-2024
03:39 AM
Hi, everyone
I don't quite understand the math behind the way the covariance matrix determines the CIs of regression coefficients. It is too hard for me because I know little about the matrix math. I guess there are some theories similar to the Delta method to get the results of CIs. However, I don't know where I should start. I intend to understand the proof and I would like to hear your suggestions. Thanks.
... View more