爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
楼主: 天玖Y

[作图] 回归分析的显著性检验问题

[复制链接]
发表于 2017-3-9 18:54:10 | 显示全部楼层
t检验结果的分布表怎么得到
密码修改失败请联系微信:mofangbao
发表于 2017-3-12 16:45:27 | 显示全部楼层
厉害了,进来学习
密码修改失败请联系微信:mofangbao
发表于 2017-4-17 17:25:58 | 显示全部楼层
小迪 发表于 2016-3-12 22:15
请问,回归系数rc和每个格点的t检验值tval这两个的含义是什么,是用回归系数画图,然后通过tval的值超过信 ...

请问你现在懂了吗
密码修改失败请联系微信:mofangbao
发表于 2017-6-21 23:07:19 | 显示全部楼层
感谢分享,有收获
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2017-10-6 05:23:21 | 显示全部楼层
subtropical 发表于 2016-4-19 11:59
楼主,用ttest检验可以吗?

楼主生娃去了,好久没来家园看帖子了,实在不好意思相信你的问题应该都解决了
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2017-10-6 05:25:01 | 显示全部楼层
zongqing123 发表于 2016-9-17 21:51
楼主可以整理一下把脚本分享一下吗?非常需要呀谢谢

begin
time=45
nx=360
ny=180
;missing_value=-1.0E+30
lat = fspan(-89.5,89.5,180)
lon = fspan(-179.5,179.5,360)
lat@units = "degrees_north"
lon@units = "degrees_east"

x=fbindirread("/cygdrive/d/YYW/nino34/winter-nor/acc.grd",0,(/time/),"float")

x!0="time"
                      ;std_f=stddev(f)
                      ;print(std_f)   ;计算年际标准差
y=fbindirread("/cygdrive/d/YYW/regression/sst/ACCESM1-0.grd",0,(/time,ny,nx/),"float")
y!0="time"
y!1="lat"
y!2="lon"
y&lat=lat
y&lon=lon
;printVarSummary(y)   


rc = regCoef(x, y(lat|:,lon|:,time|:) )   ;交换维数,使最右维与x的最右维相同
rc!0   = "lat"    ; name dimensions
rc!1   = "lon"
rc&lat = y&lat   ; assign coordinate values to named dimensions
rc&lon = y&lon
;printVarSummary(rc)           ; variable overview
;rc@long_name   = "regression coefficient"

fout2="rc-ACCESM1-0.grd"
fbinrecwrite(fout2,-1,(/rc/))

tval = onedtond(rc@tval , dimsizes(rc))   ;t-statistic
;printVarSummary(tval)
tval@FillValue= 9.96921e+36
tval!0   = "lat"    ; name dimensions
tval!1   = "lon"
tval&lat = y&lat   ; assign coordinate values to named dimensions
tval&lon = y&lon
tval@long_name = "probability"

;fout="111.txt"
;asciiwrite(fout,(/tval/))
fout="t-ACCESM1-0.grd"
fbinrecwrite(fout,-1,(/tval/))

wks = gsn_open_wks("png","ACCESM1-0")
gsn_define_colormap(wks,"bluered")
res = True
res@gsnDraw = False
res@gsnFrame = False
res@cnInfoLabelOn = False
res@cnFillOn = False
res@cnLinesOn = True
res@cnLineLabelsOn = False
;res@gsnSpreadColors = True
res@lbLabelBarOn = False
res@tiMainString = ""
res@gsnRightString = ""
res@cnLevelSelectionMode = "ManualLevels"
res@cnMinLevelValF = -0.6
res@cnMaxLevelValF = 2.4
res@cnLevelSpacingF = 0.3
;res@mpCenterLonF = 180
res@gsnContourNegLineDashPattern=1
res@gsnContourZeroLineThicknessF=3
res@gsnAddCyclic=False

plot1 = gsn_csm_contour(wks,rc,res)

res2 = True
res2@cnFillOn = True
res2@cnLinesOn = False
;res2@mpCenterLonF = 180
res2@gsnDraw         = False                      ; do not draw  
res2@gsnFrame        = False                      ; do not advance frame
res2@gsnMaximize           = True

res2@mpCenterLonF         = 120.               ; center plot at 180
  res2@mpMinLonF            = -60.               ; select a subregion
  res2@mpMaxLonF            = 300.
  res2@mpMinLatF            = -70.
  res2@mpMaxLatF            =  60.

;res2@cnMonoFillPattern = False

;res2@cnLevelSelectionMode  = "ManualLevels"   ; set manual contour levels
;res2@cnMinLevelValF        = 0.1         ; set min contour level
;res2@cnMaxLevelValF        = 5.         ; set max contour level
;res2@cnLevelSpacingF       = 1.          ; set contour interval

res2@lbLabelBarOn= True
res2@cnLevelSelectionMode = "ExplicitLevels"
res2@cnLevels = (/-2.02,2.02/)     ;; set to significance level
res2@cnFillColors =(/35,0,207/)
res2@gsnLeftString = ""
res2@mpFillDrawOrder= "PostDraw"

plot3 = gsn_csm_contour_map(wks,tval,res2)

overlay(plot3,plot1)
draw(plot3)
frame(wks)

end
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2017-10-6 05:26:46 | 显示全部楼层
zjchris 发表于 2017-3-9 18:54
t检验结果的分布表怎么得到

使用函数regCoef,tval就是t检验值
密码修改失败请联系微信:mofangbao
发表于 2018-3-9 21:59:37 | 显示全部楼层
res2@cnFillPatterns = (/3/)   ,这是填充的线,请问哪个source可以让填充的线变粗。
密码修改失败请联系微信:mofangbao
发表于 2018-10-11 11:21:10 | 显示全部楼层
学习学习!感谢分享
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表