- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 11-19-2020 09:17 AM
(1829 views)
How would i go about performing a log y (log transformation) on a single variable in my data set. This is so I’m able to perform a linear regression
6 REPLIES 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Use the Log Function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I tried this but my data still doesn’t follow a normal dist. Any idea why?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Your data does not have to be normally distributed to run a linear regression.
This is a good article on the topic: On the assumptions (and misconceptions) of linear regression .
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @PeterClemmensen,
I think your link points to "Need to log-transform a distribution? There's a SAS function for that!" (which is also an interesting article), but of course you mean "On the assumptions (and misconceptions) of linear regression."
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Oh, yes of course. Corrected, thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
*Log Transfrom single variable;
data work.prac;
set project1.hiv;
LogA = log(A);
LogB = log(B);
run;
Try this. (using log function)