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

Showing results for

- Home
- /
- Programming
- /
- SAS Procedures
- /
- How to get n values for these?

Options

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

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

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

Posted 04-21-2022 04:39 PM
(851 views)

Hello everyone,

I have the below output. I would also want to have N values for these. How can we produce them for all 6 rows?

```
ods output Diffs = AP_3way_diffs(keep = parent _parent _q3 q3 estimate stderr adjustment adjp rename=(adjp=pval));
proc mixed data=fixptsex;
class parent Q3;
model maleprod_n = parent Q3 parent*Q3;
lsmeans parent*Q3 / diff adjust=tukey;
run;
```

My output from this was as below:

I would also like to have individual N values for each row.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

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

Not counting the cell where Q3 is missing ... you have four different combinations, and those are the N values.

The PROC MIXED output gives the differences between the LSMEANS, that is 6 differences (Four things taken two at a time is 4*3/2 = 6). There isn't really an N for the differences of LSMEANS in this case, but since you have the PROC FREQ output, you can indicate somehow how many data points are in each combination of the original variables.

--

Paige Miller

Paige Miller

3 REPLIES 3

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

You want this ??

```
proc FREQ data=fixptsex;
tables parent * Q3 / missing list;
run;
/* end of program */
```

Koen

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

This is the freq by q3 and parent.

It is not including maleprod or cross tabluation by q3*parent q3*parent. How would I also include but just get 6 obs.

I tried the code you provided. It's giving me as below:

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

Not counting the cell where Q3 is missing ... you have four different combinations, and those are the N values.

The PROC MIXED output gives the differences between the LSMEANS, that is 6 differences (Four things taken two at a time is 4*3/2 = 6). There isn't really an N for the differences of LSMEANS in this case, but since you have the PROC FREQ output, you can indicate somehow how many data points are in each combination of the original variables.

--

Paige Miller

Paige Miller

**SAS Innovate 2025** is scheduled for May 6-9 in Orlando, FL. Sign up to be **first to learn** about the agenda and registration!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Ready to level-up your skills? Choose your own adventure.