データを連続的にグループ化するためのバイナリフラグの設定こんにちは、
積雪データがいくつかありますが、表を使用して積雪の存在の開始日と終了日をさまざまな時間間隔(月、水年、年)で判断できるようにしたいです。概要。
現在の行に雪の次の5行を加えたものに雪データ(> 0)が含まれる場合、col(x)値を1に設定します。雪が10列以上連続している場合は、これをうまく機能させることができます。積雪の連続行数が10未満の場合、次のコードを使用して次の結果が得られます。
雪の旗
0 0.0
0 0.0
1 1.0
1 2.0
0 3.0
0 4.0
1 5.0
1 6.0
0 0.0
0 0.0
0 0.0
0 0.0
もし(
:名前( "snow")> 0&Lag(:名前( "snow")> 0、-1)&
Lag(:名前( "snow")> 0、-2)&Lag(:
:名前( "snow")> 0、
-3
)&Lag(:名前( "snow")> 0、-4)| :お名前( "snow")>
0&Lag(:名前( "snow")> 0、1)&
Lag(:名前( "snow")> 0、2)&Lag(
:名前( "snow")> 0、
3
)&Lag(:名前( "snow")> 0、4)、
1、
0
)
これを正しい、またはより良い方法で行う方法についてのアイデアはありますか?この計算には異なるしきい値レベルを作成する必要があるため、7、10、21日連続したデータに有効なものを用意することが不可欠です。再:データの連続的なグループ化のためのバイナリフラグを設定するごめんなさい、
私はそのように書いたことを忘れました。あなたは確かに最初に述べたように問題を解決しました。私は下記の変更が好きです。この問題にご協力いただきありがとうございます。再:データの連続的なグループ化のためのバイナリフラグを設定する役に立った 連続行数については、元の説明のフラグを設定してください 「現在の行に雪の次の5行を加えたものに雪データ(> 0)が含まれている場合は、col(x)値を1に設定したいです。」
厳密な要件n = 5の場合は変更のみ
style = "WORD-SPACING:0px; FONT:16px / 20px 'Times New Roman'; TEXT-TRANSFORM:なし; COLOR:rgb(0,0,0); TEXT-INDENT:0px; WHITE-SPACE:通常; LETTER -SPACING:通常; BORDER-COLLAPSE:分離; TEXT-ALIGN:左;孤児:2;未亡人:2; webkit-border-horizontal-spacing:0px; webkit-border-vertical-spacing:0px; webkit-text-decorationsインエフェクト:なし、webkitテキストサイズの調整:自動、webテキストストロークの幅:0px ">
class = Apple-style-span
style = "フォントサイズ:13ピクセル;行の高さ:16ピクセル;フォントファミリー:arial、helvetica、sans-serif">
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
クラス= Apple-換算スペース>
style = "フォントサイズ:10pt;カラー:rgb(0,0,221);フォントファミリー: 'Courier New'"> If
style = "フォントサイズ:10pt;カラー:ブラック;フォントファミリー: 'Courier New'">(
style = "フォントサイズ:10pt;カラー:rgb(0,0,221);フォントファミリー: 'Courier New'">最大
style = "フォントサイズ:10pt;カラー:ブラック;フォントファミリー: 'Courier New'">(
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
クラス= Apple-換算スペース> の
クラス= Apple-換算スペース> )
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'" >>
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'"> n
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">、
style = "フォントサイズ:10pt;カラー:ティール;フォントファミリー: 'Courier New'"> 1
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">、
style = "フォントサイズ:10pt;カラー:ティール;フォントファミリー: 'Courier New'"> 0
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
クラス= Apple-換算スペース> )
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">;
に
style = "WORD-SPACING:0px; FONT:16px / 20px 'Times New Roman'; TEXT-TRANSFORM:なし; COLOR:rgb(0,0,0); TEXT-INDENT:0px; WHITE-SPACE:通常; LETTER -SPACING:通常; BORDER-COLLAPSE:分離; TEXT-ALIGN:左;孤児:2;未亡人:2; webkit-border-horizontal-spacing:0px; webkit-border-vertical-spacing:0px; webkit-text-decorationsインエフェクト:なし、webkitテキストサイズの調整:自動、webテキストストロークの幅:0px ">
class = Apple-style-span
style = "フォントサイズ:13ピクセル;行の高さ:16ピクセル;フォントファミリー:arial、helvetica、sans-serif">
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">>
class = Apple-style-span
style = "WORD-SPACING:0px; FONT:16px / 20px 'Times New Roman'; TEXT-TRANSFORM:なし; COLOR:rgb(0,0,0); TEXT-INDENT:0px; WHITE-SPACE:通常; LETTER -SPACING:通常; BORDER-COLLAPSE:分離; TEXT-ALIGN:左;孤児:2;未亡人:2; webkit-border-horizontal-spacing:0px; webkit-border-vertical-spacing:0px; webkit-text-decorationsインエフェクト:なし、webkitテキストサイズの調整:自動、webテキストストロークの幅:0px ">
class = Apple-style-span
style = "フォントサイズ:13ピクセル;行の高さ:16ピクセル;フォントファミリー:arial、helvetica、sans-serif">
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
クラス= Apple-換算スペース>
style = "フォントサイズ:10pt;カラー:rgb(0,0,221);フォントファミリー: 'Courier New'"> If
style = "フォントサイズ:10pt;カラー:ブラック;フォントファミリー: 'Courier New'">(
style = "フォントサイズ:10pt;カラー:rgb(0,0,221);フォントファミリー: 'Courier New'">最大
style = "フォントサイズ:10pt;カラー:ブラック;フォントファミリー: 'Courier New'">(
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
クラス= Apple-換算スペース> の
クラス= Apple-換算スペース> )
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">>
色=赤> > =
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'"> n
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">、
style = "フォントサイズ:10pt;カラー:ティール;フォントファミリー: 'Courier New'"> 1
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">、
style = "フォントサイズ:10pt;カラー:ティール;フォントファミリー: 'Courier New'"> 0
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
クラス= Apple-換算スペース> )
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">;
コードを読みやすくするため。再:データの連続的なグループ化のためのバイナリフラグを設定する提案をありがとう。私はあなたが提供したコードに基づいてJMPをプログラムする追加の方法について多くを学びました。唯一の問題は、n = 5を希望の値より1だけ小さくなるように変更しなければならなかったことです。すなわち、n = 5の場合、2値フラグが設定される前に、雪データの連続行数は6である必要がある。n = 4に変更することによって、プログラムは、5行の連続したデータ行があるときにフラグを設定します。あなたの提案をありがとうそしてこれを助けなさい。再:データの連続的なグループ化のためのバイナリフラグを設定する次の式を試してください。"n = 5"は、行内の5行を超える行が雪データを超える場合にflagを1に設定することを定義します。お役に立てれば。
style = "フォントサイズ:10pt;カラー:#0000dd;フォントファミリー: 'Courier New'">ローカル
style = "フォントサイズ:10pt;カラー:ブラック;フォントファミリー: 'Courier New'">(
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
{ 私
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">、
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
n
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'"> =
style = "フォントサイズ:10pt;カラー:ティール;フォントファミリー: 'Courier New'"> 5
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">、
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'"> s
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'"> =
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:#0000dd;フォントファミリー: 'Courier New'"> J
style = "フォントサイズ:10pt;カラー:ブラック;フォントファミリー: 'Courier New'">(
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:ティール;フォントファミリー: 'Courier New'"> 2
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'"> *
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'"> n
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'"> +
style = "フォントサイズ:10pt;カラー:ティール;フォントファミリー: 'Courier New'"> 2
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">、
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:ティール;フォントファミリー: 'Courier New'"> 1
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">、
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:ティール;フォントファミリー: 'Courier New'"> 0
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
)}
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">、
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "mso-tab-count:1">
style = "フォントサイズ:10pt;カラー:#0000dd;フォントファミリー: 'Courier New'">について
style = "フォントサイズ:10pt;カラー:ブラック;フォントファミリー: 'Courier New'">(
style = "フォントサイズ:10pt;カラー:ブラック;フォントファミリー: 'Courier New'"> i
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'"> =
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'" - -
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'"> n
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">、
style = "フォントサイズ:10pt;カラー:ブラック;フォントファミリー: 'Courier New'"> i
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'"> <=
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
n
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">、
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
私
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'"> ++、
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "mso-tab-count:2">
style = "フォントサイズ:10pt;カラー:#0000dd;フォントファミリー: 'Courier New'"> If
style = "フォントサイズ:10pt;カラー:ブラック;フォントファミリー: 'Courier New'">(
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">:
style = "フォントサイズ:10pt;カラー:ブラック;フォントファミリー: 'Courier New'">雪 [
style = "フォントサイズ:10pt;カラー:#0000dd;フォントファミリー: 'Courier New'">行
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">()
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'"> +
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
私
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">、
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:#0000dd;フォントファミリー: 'Courier New'">空
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">()]
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'" >>
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:ティール;フォントファミリー: 'Courier New'"> 0
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">、
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "mso-tab-count:3">
の [ 私
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'"> +
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
n
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'"> +
style = "フォントサイズ:10pt;カラー:ティール;フォントファミリー: 'Courier New'"> 2
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">、
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:ティール;フォントファミリー: 'Courier New'"> 1
style = "フォントサイズ:10pt;カラー:ブラック;フォントファミリー: 'Courier New'">]
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'"> =
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'"> s [(( 私
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'"> +
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
n
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'"> +
style = "フォントサイズ:10pt;カラー:ティール;フォントファミリー: 'Courier New'"> 2
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">)
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'" - -
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:ティール;フォントファミリー: 'Courier New'"> 1
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">、
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:ティール;フォントファミリー: 'Courier New'"> 1
style = "フォントサイズ:10pt;カラー:ブラック;フォントファミリー: 'Courier New'">]
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'"> +
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:ティール;フォントファミリー: 'Courier New'"> 1
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "mso-tab-count:2">
)
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "mso-tab-count:1">
)
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">;
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "mso-tab-count:1">
style = "フォントサイズ:10pt;カラー:#0000dd;フォントファミリー: 'Courier New'"> If
style = "フォントサイズ:10pt;カラー:ブラック;フォントファミリー: 'Courier New'">(
style = "フォントサイズ:10pt;カラー:#0000dd;フォントファミリー: 'Courier New'">最大
style = "フォントサイズ:10pt;カラー:ブラック;フォントファミリー: 'Courier New'">(
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'"> s
)
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'" >>
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'"> n
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">、
style = "フォントサイズ:10pt;カラー:ティール;フォントファミリー: 'Courier New'"> 1
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">、
style = "フォントサイズ:10pt;カラー:ティール;フォントファミリー: 'Courier New'"> 0
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
)
style = "フォントサイズ:10pt;カラー:ネイビー;フォントファミリー: 'Courier New'">;
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">>
style = "フォントサイズ:10pt;カラー:黒;フォントファミリー: 'Courier New'">)