20 hours ago
TomHsiung
Pyrite | Level 9
Member since
01-04-2018
- 128 Posts
- 46 Likes Given
- 3 Solutions
- 6 Likes Received
-
Latest posts by TomHsiung
Subject Views Posted 288 20 hours ago 391 yesterday 418 yesterday 450 yesterday 224 Sunday 487 a month ago 561 a month ago 612 a month ago 608 a month ago 646 a month ago -
Activity Feed for TomHsiung
- Posted Re: Can we do the approximately unbiased estimator for the probability density function of cont. var on Statistical Procedures. 20 hours ago
- Liked Re: Can we do the approximately unbiased estimator for the probability density function of cont. var for Season. 20 hours ago
- Liked Re: Can we do the approximately unbiased estimator for the probability density function of cont. var for Sa_S. yesterday
- Posted Re: Can we do the approximately unbiased estimator for the probability density function of cont. var on Statistical Procedures. yesterday
- Liked Re: Can we do the approximately unbiased estimator for the probability density function of cont. var for Season. yesterday
- Got a Like for Re: Can we do the approximately unbiased estimator for the probability density function of cont. var. yesterday
- Posted Re: Can we do the approximately unbiased estimator for the probability density function of cont. var on Statistical Procedures. yesterday
- Liked Re: Can we do the approximately unbiased estimator for the probability density function of cont. var for Sa_S. yesterday
- Got a Like for Can we do the approximately unbiased estimator for the probability density function of cont. var?. yesterday
- Posted Can we do the approximately unbiased estimator for the probability density function of cont. var? on Statistical Procedures. yesterday
- Liked Re: SAS data platform, where? Accessible? for Ksharp. Wednesday
- Liked Re: SAS data platform, where? Accessible? for quickbluefish. Wednesday
- Posted SAS data platform, where? Accessible? on Administration and Deployment. Sunday
- Liked Re: Spline plot after proc phreg for SteveDenham. 4 weeks ago
- Liked Re: Spline plot after proc phreg for Season. 4 weeks ago
- Liked Re: Spline plot after proc phreg for Ksharp. 4 weeks ago
- Posted Re: Spline plot after proc phreg on Statistical Procedures. a month ago
- Posted Re: Spline plot after proc phreg on Statistical Procedures. a month ago
- Posted Spline plot after proc phreg on Statistical Procedures. a month ago
- Liked Re: how to convert a continuous variable age as cubic splines (25th, 75th percentile)? for Rick_SAS. a month ago
-
Posts I Liked
Subject Likes Author Latest Post 1 1 3 1 1 -
My Liked Posts
Subject Likes Posted 1 yesterday 1 yesterday 2 04-23-2024 02:51 AM 2 04-19-2024 11:38 AM
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
03-30-2024
01:41 AM
Got it. Thank you for your help. Koen.
... View more
03-29-2024
07:28 AM
There are many ways to model a Weibull distribution (reference: https://www.mdpi.com/2227-7390/12/1/56).
Some textbooks use a parametric proportional hazard model to construct the likelihood function. Others include the accelerated failure time (AFT) model, and so on. My question is what is the model used for the PROC LIFEREG procedure? Thanks.
Code below.
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;
... View more
02-12-2024
08:49 AM
Hello, sir or madam
Thank you for your reply and I think a scenario would help to express more clearly of my idea.
The maximum likelihood of Poisson regression requires the calculation of the joint likelihood function. For Poisson regression, observations are categorized by their characteristics into several groups and each has a likelihood function expressed via the probability mass function of Poisson distribution.
Saying, we have a model of log(λ) = a +bX and X is the independent variable. Assume we have 100 observations and we designed X for the representation of age groups in the unit of decade. Therefore, the observations are categorized by X into several groups (a discrete variable), and each group could have sample λ of integrals other than 0 and 1, which fits the Poisson distribution.
However, if we use designed X for the representation of age in the unit of second (similar to a continuous variable), for these 100 observations, it is very likely they will be categorized into 100 groups. For each group, the λ could be only 0 or 1, which violates the assumption of Poisson distribution.
... View more
02-04-2024
04:21 AM
The Poisson regression should have a response variable of a natural number (e.g., 0, 1, 2, ..., n). Hypothesis: If we include a continuous independent variable in the Poisson regression model, the result probably would be that there is only one observation that has the exact value of that independent variable (because the value of that independent is so precision, e.g., two or more numbers after the decimal). This causes a problem because the response variable, given my hypothesis, is impossible to be any natural numbers except 0 and 1. This results in a binomial distribution instead of a Poisson distribution.
Above is my idea. I hope to hear your ideas. You're welcome.
Thanks.
... View more
12-23-2023
03:15 AM
I have read parts of this paper (https://pubmed.ncbi.nlm.nih.gov/35924051/). In the statistical method section, it described,
Daily medication exposure and processes of care (sedative, acid inhibitors, blood transfusion, mandatory ventilation, and head-of-bed elevation, gastrointestinal decompression, and rehabilitation exercise) and medications (sedatives, opioids, neuromuscular blockers, immunosuppressive agent, neuroleptic agents, antibiotics, expectorants, vasopressors, intestinal probiotics, and neuroleptic agents) were defined as time-varying variables. Time-varying variables were measured as daily exposure from initiation of MV to the event of interested for the model of VAEs and each day from ICU admission to ICU discharge for the model of ICU discharge and ICU mortality.
It looks like the authors included a dozen time-varying cofactors in their Cox regression model. So, I wonder how they handled the dataset. Each patient could have a dozen time-varying cofactors, and each such cofactor could have several different values. To record the data into a dataset must be a tough mission but I don't know how they did it.
... View more
11-28-2023
04:09 AM
Hi, everyone
I just learned how to process time-varying data in PROC PHREG but I only know how to do so for a data set that has only one time-varying variable. I wonder if is it possible to do the time-dependent Cox regression with two, three, or more independent cofactors (i.e., observations received several different exposures at different times). Thanks.
... View more
11-21-2023
08:11 AM
And after some google later, I found the link = log is a model called "log-binomial regression" (https://stats.stackexchange.com/questions/581678/what-is-the-difference-between-a-logistic-regression-and-log-binomial-regression )
The thread says,
Logistic regression always produces estimates of 𝑝𝑖 that are between 0 and 1. This is not true for log-binomial regression;
I guess this is the reason why few people use the log-binomial regression to model their data because the risk of deriving a risk higher than 100%. Thanks.
... View more
11-19-2023
05:03 AM
Hi, everyone
Recently I have been learning logistic regression. I know that PROC GENMOD could be used to do a logistic regression with the option link = logit. However, with the link = logit I can only get the odds ratio. I am more interested in the relative risk and what I found via Google is the same PROC GENMOD but with an option of link = log.
So, my question is: Does the PROC GENMOD still do a logistic regression with the option of link = log? If yes, what is the math behind it? If not, then what is the mathematical mode it uses? Thanks
... View more
- Tags:
- relative risk
08-31-2023
01:23 PM
/*Spline for hazard ratios*/
%macro SplineHR;
proc phreg data = &raw_data_name plots = cumhaz;
class &class_var;
effect SplALB = spline(serumAlb/naturalcubic);
model &length*&censor(0) = &indep_list / rl=Wald;
*effectplot fit(x=serumAlb);
*effectplot fit(x=serumAlb) / link;
hazardratio serumAlb / at(serumAlb = 25 to 45);
run;
%mend;
%SplineHR
Hello, everyone.
With the above macro and other codes, I indeed got the expected outcome. But, unlike PROC LOGISTIC, they are listed as a table instead of a spline plot. Any suggestion for making the plot? Thanks.
... View more
08-31-2023
10:44 AM
Exactly! This is the issue. I specified serumALB instead of SplALB in the MODEL statement. After correcting this error, everything followed as expected. Thank you.
... View more
08-31-2023
06:41 AM
Hello, Dave.
Wow! That's a great reference. Thanks. I copied and edited the code to suit my project. But, so far, I have never get the Odd Ratio plot as shown in the first example. My code only generated one column for the variable of serumAlb. I am just not able to make it. Your investigation would be of great important. Thanks.
My code:
%macro Logistic2;
proc logistic data= &raw_data_name plots = oddsratio(type=vertical);
class &class_var;
effect SplALB=spline(serumAlb/naturalcubic);
model &censor(event = '1') = &indep_list;
effectplot fit(x=serumAlb);
effectplot fit(x=serumAlb) / link;
oddsratio serumAlb / at(serumAlb=34.8125 36.0425 37.35 39.0 40.92);
store kmod;
run;
%mend;
%Logistic2
... View more
- Tags:
- ello
08-31-2023
03:28 AM
Thanks for these advice, ballardw.
Yep, I will follow your guide.
... View more
- Tags:
- sk
08-29-2023
02:07 AM
Hi, Quentin Thanks for you comments. Well, today I re-ran the code and it did not reproduce the issue. Therefore, I am not able to reproduce the error log. I use SAS University edition and my networking connection was bad yesterday. Maybe the networking lag caused this issue. Thank you.
... View more
08-28-2023
01:33 PM
/*Cox Regression*/
%let class_var = genderC;
%let length = timeToFirstInrAttain;
%let response_var = firstInrAttain;
%let indep_list = ageY genderC BSA AF Hypertension CHF serumAlb akiC ddiC indicationC CYP2C9code VKORC1Code;
%macro Cox;
proc phreg data = &raw_data_name;
class &class_var;
model &length*&response_var(1) = &indep_list;
run;
%mend;
The &indep_list was read by the PROC PHREG as the very &indep_list, instead of the 12 vars it represented. I compared this with PROC LOGISTIC and the later PROC does not have this issue.
... View more