Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Calculating weight for site effect based on standard error

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 4 weeks ago
(422 views)

Hello, I am trying to explore the site effect in a clinical study where the site effect is significant. I have to find the weighted estimate using the proc mixed model "where the weight of each site is the inverse of the variance of each site estimate (which equals the inverse of the square of the standard error of each site estimate)."

Am I able to use the standard errors produced by the ls means statement to produce the “standard error of each site estimate”?

9 REPLIES 9

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

@ashmork wrote:

Hello, I am trying to explore the site effect in a clinical study where the site effect is significant. I have to find the weighted estimate using the proc mixed model "where the weight of each site is the inverse of the variance of each site estimate (which equals the inverse of the square of the standard error of each site estimate)."

Am I able to use the standard errors produced by the ls means statement to produce the “standard error of each site estimate”?

Is the reason you ask because you want to create a weighted regression? In that case, you can see a solution here: https://communities.sas.com/t5/SAS-Programming/Weighted-Least-Square-for-Simple-Linear-Regression/m-...

Or do you have some other reason for wanting this?

--

Paige Miller

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hello,

Thanks for your apply. Is this able to be done with a linear mixed model?

Thanks for your apply. Is this able to be done with a linear mixed model?

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

I don't understand. I don't see where you have answered my question.

--

Paige Miller

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

I might be able to do a regression model but my statistical plan specifically references a linear mixed model. So I wanted to know if this estimate, p-value, and CI can be done by a linear mixed model through proc mixed instead of proc reg?

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

You can use a WEIGHT in PROC MIXED, but I think it is computed the same as for linear regression or ANOVA. The weight is not based on the LSMEANs but on the actual data.

--

Paige Miller

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

And trying to get stderr of effect size estimation for each siteid ?

By my side, I think your are right, you could use stderr generated by LSMEANS .

But @SteveDenham , @lvm @StatDave know more things.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

If you are doing META Analysis ,you could try this formula:

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

It is not clear what you are trying to do here. It appears to me that you want to do a meta-analysis. That is, you have results from each site (means, SEs, ...), and now you want to combine to determine an overall mean and SE (effect size mean for the population of sites). If that is what you are doing, MIXED or GLIMMIX can certainly be used, where one overrides the residual with a weight term. There are tricks to the coding that are not obvious. But I don't know if that is what you are trying to do. It is possible that you simply want a hierarchical linear mixed model, but with separate residual for each site, all in one analysis (no meta-analysis). That also can be done, where you get a different residual for each site (sort of like using weights).

I can't give you code until you more fully describe what you are trying to do. Maybe with a toy example.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hmm, that does depend on what your objective is, but I will take a swing at it without knowing what your data is (site means, SDs and Ns, or raw data).

The point I want to address is whether to treat site as a fixed effect (inference is only to the sites included) or a random effect (inference is to all possible sites). All of this assumes using PROC GLIMMIX, as I am fairly certain you are not looking at data with normally distributed residuals if it is primary endpoint clinical data. So, considering SITE as a fixed effect, here is code that will yield a variance estimate for each site:

```
proc glimmix data=your_data;
class site treatment;
model response = treatment/dist= <insert appropriate distribution here>;
random _residual_/group=site;
run;
```

For SITE as a random effect, you could try:

```
proc glimmix data=your_data;
class site treatment;
model response = treatment/dist= <insert appropriate distribution here>;
random intercept/subject=site solution;
run;
```

Using ODS output statements, you can get the variance estimates for each site from code like this. Weights can then be calculated as 1/variance, merged back against the original dataset, and the data refit using a WEIGHT statement. The Type 3 F test for this analysis reflects any differences in treatment effect after weighting by site.

I am not a clinical biostatistician, but the meta-analyses I have seen generally treat site as a fixed effect. You might want to talk with others about the choice.

SteveDenham

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

**If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. **

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.