09-16-2024
Mike_N
SAS Employee
Member since
02-20-2023
- 47 Posts
- 0 Likes Given
- 9 Solutions
- 61 Likes Received
-
Latest posts by Mike_N
Subject Views Posted 977 07-31-2024 01:23 PM 999 07-31-2024 12:20 PM 845 07-25-2024 09:54 AM 2418 07-19-2024 02:55 PM 3330 07-18-2024 02:58 PM 3395 07-18-2024 02:05 PM 3442 07-18-2024 11:50 AM 965 07-17-2024 09:34 AM 2903 07-12-2024 10:44 AM 3027 07-11-2024 01:30 PM -
Activity Feed for Mike_N
- Posted Re: Test Proportional Hazards Assumption in Recurrent Event Model on Statistical Procedures. 07-31-2024 01:23 PM
- Posted Re: Test Proportional Hazards Assumption in Recurrent Event Model on Statistical Procedures. 07-31-2024 12:20 PM
- Got a Like for Re: Sample size calculation for Poisson regression. 07-27-2024 02:05 AM
- Got a Like for Re: Sample size calculation for Poisson regression. 07-25-2024 11:18 AM
- Posted Re: Sample size calculation for Poisson regression on Statistical Procedures. 07-25-2024 09:54 AM
- Got a Like for Re: How do i get a block diagonal covariance matrix, V, in SAS Proc Mixed or Proc glimmix?. 07-23-2024 10:11 AM
- Got a Like for Re: How do i get a block diagonal covariance matrix, V, in SAS Proc Mixed or Proc glimmix?. 07-23-2024 10:09 AM
- Got a Like for Re: Trying to recreate linear mixed models and corresponding graphs in SAS. 07-23-2024 09:35 AM
- Got a Like for Re: Trying to recreate linear mixed models and corresponding graphs in SAS. 07-19-2024 03:54 PM
- Got a Like for Re: Trying to recreate linear mixed models and corresponding graphs in SAS. 07-19-2024 03:33 PM
- Posted Re: Trying to recreate linear mixed models and corresponding graphs in SAS on Statistical Procedures. 07-19-2024 02:55 PM
- Got a Like for Re: How do i get a block diagonal covariance matrix, V, in SAS Proc Mixed or Proc glimmix?. 07-18-2024 03:41 PM
- Posted Re: How do i get a block diagonal covariance matrix, V, in SAS Proc Mixed or Proc glimmix? on Statistical Procedures. 07-18-2024 02:58 PM
- Got a Like for Re: How do i get a block diagonal covariance matrix, V, in SAS Proc Mixed or Proc glimmix?. 07-18-2024 02:07 PM
- Posted Re: How do i get a block diagonal covariance matrix, V, in SAS Proc Mixed or Proc glimmix? on Statistical Procedures. 07-18-2024 02:05 PM
- Posted Re: How do i get a block diagonal covariance matrix, V, in SAS Proc Mixed or Proc glimmix? on Statistical Procedures. 07-18-2024 11:50 AM
- Got a Like for Re: PROC UNIVARIATE Signed Rank S statistic and associated Pr >=|S| (p-value). 07-18-2024 07:47 AM
- Got a Like for Re: PROC UNIVARIATE Signed Rank S statistic and associated Pr >=|S| (p-value). 07-17-2024 10:34 AM
- Posted Re: PROC UNIVARIATE Signed Rank S statistic and associated Pr >=|S| (p-value) on Statistical Procedures. 07-17-2024 09:34 AM
- Posted Re: Stratified Newcombe method when zero responder in control arm on SAS Programming. 07-12-2024 10:44 AM
-
My Liked Posts
Subject Likes Posted 4 07-25-2024 09:54 AM 1 07-18-2024 02:05 PM 4 07-19-2024 02:55 PM 1 07-18-2024 02:58 PM 2 07-18-2024 11:50 AM
07-31-2024
01:23 PM
I don't think there is a built-in way to get model diagnostics for the proportional means model. As you noted, the ASSESS statement is used to examine proportional hazards, not proportional means/rates. The LWYY paper (Semiparametric Regression for the Mean and Rate Functions of Recurrent Events | Journal of the Royal Statistical Society Series B: Statistical Methodology | Oxford Academic (oup.com)) does provide a section that specifies how to carry out model checks based on residuals, but those methods are not implemented in SAS (to my knowledge).
The process is similar to that implemented in the ASSESS statement for proportional hazards models. You would need to use the OUTPUT statement from PROC PHREG to store the martingale residuals and then use those in the model-checking methods described in LWYY.
... View more
07-31-2024
12:20 PM
To begin, have a look at this page: SAS Help Center: Analysis of Multivariate Failure Time Data . Which model do you intend to fit?
... View more
07-25-2024
09:54 AM
4 Likes
I think the way to do this is to use PROC POWER with a CUSTOM statement. See this example: SAS Help Center: Logistic Regression Using the CUSTOM Statement. The linked example is for logistic regression, but you can adapt the approach for other generalized linear models, like a Poisson model.
... View more
07-19-2024
02:55 PM
4 Likes
I think @Rick_SAS is saying you need to specify the same model in both R and SAS. As stated by @PaigeMiller, one way to do that is to treat all of the predictors in your SAS model as continuous by specifying them in the model statement and not the class statement.
The other way is to treat the class variables from the SAS model as factors in your R model. That is:
m1 <- lmer(interest1 ~ time*randomization + age + factor(education) + sex + factor(income) + (1|record_id)
The choice will depend on how education and income are coded, and whether it is reasonable to assume a linear relationship between those variables and the model outcome. Treating those variables as categorical does not require that kind of assumption but will usually decrease the power of statistical tests (i.e., you will get higher p-values) compared to treating those variables as continuous.
... View more
07-18-2024
02:58 PM
1 Like
I don't think I completely understand what you mean by the 'original' variable names - but renaming the variables won't fix this issue, if that is your question. You should not ignore the warning about the G matrix and you should likewise take note of all of the zeros in the covariance parameter estimates table. I still suspect your subject effect is misspecified, but I can't tell exactly how without your data. I would suggest first trying to fit a simpler model, such as a random-intercept model. That is
random int / subject = Incorp v;
Once you get that working, start adding in other random factors.
... View more
07-18-2024
02:05 PM
1 Like
Your subject effect, FactorC, has one distinct level. All 120 observations have the value 'ra'. The subject= part of your model is not specified correctly. The documentation links above should help get you back on the right track.
... View more
07-18-2024
11:50 AM
2 Likes
When you use the V option of the random statement in either Proc Glimmix or Proc Mixed, the default behavior is to print out the first (single) block from the V matrix, not the whole block diagonal matrix. However, both procedures are still using block diagonal V. Note that blocks are usually defined by using the subject= option within the random statement. See here SAS Help Center: RANDOM Statement and here SAS Help Center: RANDOM Statement for more details about how to use the subject= statement to specify the blocks of V.
... View more
07-17-2024
09:34 AM
4 Likes
The method for calculating the p-value is at the bottom of this page: SAS Help Center: Tests for Location. For non-exact p-values, it looks like proc univariate uses a t distribution with a complicated transformation of S. The linked page also gives references for this method.
... View more
07-12-2024
10:44 AM
The macro is giving you the wrong answer. This is technical, but the macro doesn't properly handle missing values in the section that uses proc IML. In proc IML, as stated in the warning, division by zero produces a matrix of missing values. However, if you take the sum of a matrix of missing values, you will get zero, which is probably not what you expect. For example, try running the following code:
proc iml;
x = {. . , . . };
print x;
y = x[+, ];
print y;
run;
The code stores the column sums of the matrix x in the matrix y. You'll note, however, that y is a matrix of zeros, even though the intuitive result would be a matrix of missing values. (The reasons for this behavior are beyond the scope of this post).
This comes into play in the following lines of the macro:
newcombe_L2 =wilson_L2[+,];
newcombe_U2 =wilson_U2[+,];
The wilson_L2 and wilson_U2 matrices contain only missing values, but newcombe_L2 and newcombe_U2 will contain zeros because of the behavior I described above.
Those zeros are not the correct values for the computation, and you get the wrong values for the confidence interval. Proc FREQ handles this situation correctly and gives you a note that the Newcombe confidence interval cannot be computed in this situation.
... View more
07-11-2024
01:30 PM
I get an error when I run this macro, and it fails to generate Newcombe confidence intervals. In the log, I see a 'divide by zero' warning, and a resulting error in computing the Newcome CI. In the paper you cite, look at the last term on the last line of page 2. In your simulated data, you have two strata and no responders in the placebo group in either stratum. Therefore, the denominator of that term is zero for the placebo group, which prevents the computation from proceeding.
... View more
07-10-2024
10:59 AM
Can you post the code you are running, and the associated log? Beyond giving you a reference to the appropriate documentation, it's hard to speculate on what might be going on.
... View more
07-09-2024
04:00 PM
2 Likes
The formulas for the stratified Newcombe confidence limits are given here: https://go.documentation.sas.com/doc/en/statcdc/14.3/statug/statug_freq_details62.htm
You will see that zero frequency rows/columns/cells will lead to division by zero in the formula, which is why you get that note.
... View more
06-26-2024
11:40 AM
1 Like
I think you are on the right track with that documentation link, I would recommend you re-read that example very closely. To summarize what is in the documentation, the binomial cluster model you are fitting is a two-component mixture, where the first component is binomial with 'n' trials and success probability 'mu_star + mu', the second component is binomial with 'n' trials and success probability 'mu_star', and the mixing probabilities are represented by pi and (1 - pi). Furthermore, mu_star = (1 - mu)*pi (where pi is still the mixing probability).
They show in the linked example that the estimate for the mu parameter, 'mu_hat', is computed as the inverse link of the intercept parameter in the model for mu (specified via the model statement). In the documentation example, mu_hat is equal to 0.5831. Likewise, in Table 43.11, they show how to compute estimates for the mixing parameter ('pi_hat') based on the coefficients from the model specified in the probmodel statement.
I believe that the pred statement for this model is generating the success probabilities for each of the two components of the mixture model, i.e., pred1 is mu_star_hat + mu_hat, and pred2 is mu_star hat. So, for example, for PHT = 0 and TCPO = 0, pi_hat = 0.6546, therefore mu_star_hat is (1 - 0.5831)*0.6546 = 0.273 (rounded), and mu_star_hat + mu_hat = 0.5831 + 0.273 = 0.865. Those are the values of pred_2 and pred_1 that I get, respectively, when PHT = 0 and TCPO = 0.
... View more
06-25-2024
04:10 PM
3 Likes
If possible, it's better to choose your modeling approach based on the goals of the study/analysis, rather than a statistical test. Can you give more information about your data and the question you are trying to answer?
... View more
06-06-2024
03:46 PM
2 Likes
I can't tell you for sure why you are getting that behavior. However, I will point out that, in general, bootstrapping is known to provide poor estimates of the sampling distribution of extreme order statistics. Textbook examples are the minimum and maximum. I suspect that will also be true for the 99th percentile, so I would encourage you to think carefully about whether to even use a bootstrap here.
... View more