Could be coincidental.
Diabetes type 2 is related to a sedentary lifestyle.
Vitamin D is largely obtained by getting up and going outside in the sunlight.
Nature' 'correlations' quite amazing. . .For sure you cannot get it in front of a computer screen. (A new idea for Steve Jobs/lol. . .)
Meantime, if you are not in sun; and even 'if you are' - take enough; get enough. . .'D'.
Correlation? Seems very likely. Causation? Possibly, but not determined.
In either case, gives something to work with, and maybe help find the cure or help with care / treatment. After all, if a daily (still sedentary) “activity” of sitting “on the sun” for 20 minutes, or taking a supplement can help, it’s worth studying.
Depends upon where you live. Above a certain latitude, there’s not enough UVB available, even in summertime, to activate the VitD in the body. Northern states typically.
So no matter how much you “go outside”, you won’t create enough Vit D internally and need to supplement. Your advice would be fine for CA-TX-FL latitudes, but not so good for WA-ND-WI-NY denizens.
There’s a lot more to it than just “going outside”.
One study examined for this review article evaluated 3,000 people with type 1 diabetes and found a decreased risk in disease for people who took vitamin D supplements.
Type 1 is an autoimmune disease, and if vitamin D significantly helps it, that suggests that vitamin D may be helpful for autoimmune disorders in general.
That is an oversimplification. I have chronic low Vit D. I spend hours a day outside and am anything but sedentary.